|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.codecs.PostingsConsumer
public abstract class PostingsConsumer
Abstract API that consumes postings for an individual term.
The lifecycle is:
TermsConsumer.startTerm(BytesRef)
.
startDoc(int, int)
is called for each
document where the term occurs, specifying id
and term frequency for that document.
addPosition(int, BytesRef, int, int)
will be called for each occurrence in the
document.
finishDoc()
is called when the producer
is done adding positions to the document.
Constructor Summary | |
---|---|
protected |
PostingsConsumer()
Sole constructor. |
Method Summary | |
---|---|
abstract void |
addPosition(int position,
BytesRef payload,
int startOffset,
int endOffset)
Add a new position & payload, and start/end offset. |
abstract void |
finishDoc()
Called when we are done adding positions & payloads for each doc. |
TermStats |
merge(MergeState mergeState,
FieldInfo.IndexOptions indexOptions,
DocsEnum postings,
FixedBitSet visitedDocs)
Default merge impl: append documents, mapping around deletes |
abstract void |
startDoc(int docID,
int freq)
Adds a new doc in this term. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected PostingsConsumer()
Method Detail |
---|
public abstract void startDoc(int docID, int freq) throws IOException
freq
will be -1 when term frequencies are omitted
for the field.
IOException
public abstract void addPosition(int position, BytesRef payload, int startOffset, int endOffset) throws IOException
BytesRef
for the payload between calls
(method must fully consume the payload). startOffset
and endOffset
will be -1 when offsets are not indexed.
IOException
public abstract void finishDoc() throws IOException
IOException
public TermStats merge(MergeState mergeState, FieldInfo.IndexOptions indexOptions, DocsEnum postings, FixedBitSet visitedDocs) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |