public abstract class TermsConsumer extends Object
The lifecycle is:
FieldsConsumer.addField(FieldInfo).
PostingsConsumer for
each term in startTerm(BytesRef).
finishTerm(BytesRef, TermStats), passing in
the accumulated term statistics.
finish(long, long, int) with
the accumulated collection statistics when it is finished
adding terms to the field.
| Modifier | Constructor and Description |
|---|---|
protected |
TermsConsumer()
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
finish(long sumTotalTermFreq,
long sumDocFreq,
int docCount)
Called when we are done adding terms to this field.
|
abstract void |
finishTerm(BytesRef text,
TermStats stats)
Finishes the current term; numDocs must be > 0.
|
abstract Comparator<BytesRef> |
getComparator()
Return the BytesRef Comparator used to sort terms
before feeding to this API.
|
void |
merge(MergeState mergeState,
TermsEnum termsEnum)
Default merge impl
|
abstract PostingsConsumer |
startTerm(BytesRef text)
Starts a new term in this field; this may be called
with no corresponding call to finish if the term had
no docs.
|
protected TermsConsumer()
public abstract PostingsConsumer startTerm(BytesRef text) throws IOException
IOExceptionpublic abstract void finishTerm(BytesRef text, TermStats stats) throws IOException
stats.totalTermFreq will be -1 when term
frequencies are omitted for the field.IOExceptionpublic abstract void finish(long sumTotalTermFreq,
long sumDocFreq,
int docCount)
throws IOException
sumTotalTermFreq will be -1 when term
frequencies are omitted for the field.IOExceptionpublic abstract Comparator<BytesRef> getComparator() throws IOException
IOExceptionpublic void merge(MergeState mergeState, TermsEnum termsEnum) throws IOException
IOExceptionCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.