public abstract class PostingsEnum extends DocIdSetIterator
DocIdSetIterator.nextDoc()
before using
any of the per-doc methods.Modifier and Type | Field and Description |
---|---|
static short |
ALL
Flag to pass to
TermsEnum.postings(PostingsEnum, int)
to get positions, payloads and offsets in the returned enum |
static short |
FREQS
Flag to pass to
TermsEnum.postings(PostingsEnum, int)
if you require term frequencies in the returned enum. |
static short |
NONE
Flag to pass to
TermsEnum.postings(PostingsEnum, int) if you don't
require per-document postings in the returned enum. |
static short |
OFFSETS
Flag to pass to
TermsEnum.postings(PostingsEnum, int)
if you require offsets in the returned enum. |
static short |
PAYLOADS
Flag to pass to
TermsEnum.postings(PostingsEnum, int)
if you require payloads in the returned enum. |
static short |
POSITIONS
Flag to pass to
TermsEnum.postings(PostingsEnum, int)
if you require term positions in the returned enum. |
NO_MORE_DOCS
Modifier | Constructor and Description |
---|---|
protected |
PostingsEnum()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
AttributeSource |
attributes()
Returns the related attributes.
|
abstract int |
endOffset()
Returns end offset for the current position, or -1 if
offsets were not indexed.
|
static boolean |
featureRequested(int flags,
short feature)
Returns true if the given feature is requested in the flags, false otherwise.
|
abstract int |
freq()
Returns term frequency in the current document, or 1 if the field was
indexed with
IndexOptions.DOCS . |
abstract BytesRef |
getPayload()
Returns the payload at this position, or null if no
payload was indexed.
|
abstract int |
nextPosition()
Returns the next position, or -1 if positions were not indexed.
|
abstract int |
startOffset()
Returns start offset for the current position, or -1
if offsets were not indexed.
|
advance, all, cost, docID, empty, nextDoc, slowAdvance
public static final short NONE
TermsEnum.postings(PostingsEnum, int)
if you don't
require per-document postings in the returned enum.public static final short FREQS
TermsEnum.postings(PostingsEnum, int)
if you require term frequencies in the returned enum.public static final short POSITIONS
TermsEnum.postings(PostingsEnum, int)
if you require term positions in the returned enum.public static final short OFFSETS
TermsEnum.postings(PostingsEnum, int)
if you require offsets in the returned enum.public static final short PAYLOADS
TermsEnum.postings(PostingsEnum, int)
if you require payloads in the returned enum.public static final short ALL
TermsEnum.postings(PostingsEnum, int)
to get positions, payloads and offsets in the returned enumprotected PostingsEnum()
public static boolean featureRequested(int flags, short feature)
public abstract int freq() throws IOException
IndexOptions.DOCS
. Do not call this before
DocIdSetIterator.nextDoc()
is first called, nor after DocIdSetIterator.nextDoc()
returns
DocIdSetIterator.NO_MORE_DOCS
.
NOTE: if the PostingsEnum
was obtain with NONE
,
the result of this method is undefined.
IOException
public AttributeSource attributes()
public abstract int nextPosition() throws IOException
freq()
times is undefined.IOException
public abstract int startOffset() throws IOException
IOException
public abstract int endOffset() throws IOException
IOException
public abstract BytesRef getPayload() throws IOException
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.