public abstract class PostingsConsumer extends Object
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.
| Modifier | Constructor and Description |
|---|---|
protected |
PostingsConsumer()
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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,
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.
|
protected PostingsConsumer()
public abstract void startDoc(int docID,
int freq)
throws IOException
freq will be -1 when term frequencies are omitted
for the field.IOExceptionpublic 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.IOExceptionpublic abstract void finishDoc()
throws IOException
IOExceptionpublic TermStats merge(MergeState mergeState, DocsEnum postings, FixedBitSet visitedDocs) throws IOException
IOExceptionCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.