Package org.apache.lucene.codecs
Class TermsConsumer
- java.lang.Object
 - 
- org.apache.lucene.codecs.TermsConsumer
 
 
- 
public abstract class TermsConsumer extends java.lang.ObjectAbstract API that consumes terms for an individual field.The lifecycle is:
- TermsConsumer is returned for each field 
       by 
FieldsConsumer.addField(FieldInfo). - TermsConsumer returns a 
PostingsConsumerfor each term instartTerm(BytesRef). - When the producer (e.g. IndexWriter)
       is done adding documents for the term, it calls 
       
finishTerm(BytesRef, TermStats), passing in the accumulated term statistics. - Producer calls 
finish(long, long, int)with the accumulated collection statistics when it is finished adding terms to the field. 
 - TermsConsumer is returned for each field 
       by 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidfinish(long sumTotalTermFreq, long sumDocFreq, int docCount)Called when we are done adding terms to this field.abstract voidfinishTerm(BytesRef text, TermStats stats)Finishes the current term; numDocs must be > 0.abstract java.util.Comparator<BytesRef>getComparator()Return the BytesRef Comparator used to sort terms before feeding to this API.voidmerge(MergeState mergeState, FieldInfo.IndexOptions indexOptions, TermsEnum termsEnum)Default merge implabstract PostingsConsumerstartTerm(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. 
 - 
 
- 
- 
Method Detail
- 
startTerm
public abstract PostingsConsumer startTerm(BytesRef text) throws java.io.IOException
Starts a new term in this field; this may be called with no corresponding call to finish if the term had no docs.- Throws:
 java.io.IOException
 
- 
finishTerm
public abstract void finishTerm(BytesRef text, TermStats stats) throws java.io.IOException
Finishes the current term; numDocs must be > 0.stats.totalTermFreqwill be -1 when term frequencies are omitted for the field.- Throws:
 java.io.IOException
 
- 
finish
public abstract void finish(long sumTotalTermFreq, long sumDocFreq, int docCount) throws java.io.IOExceptionCalled when we are done adding terms to this field.sumTotalTermFreqwill be -1 when term frequencies are omitted for the field.- Throws:
 java.io.IOException
 
- 
getComparator
public abstract java.util.Comparator<BytesRef> getComparator() throws java.io.IOException
Return the BytesRef Comparator used to sort terms before feeding to this API.- Throws:
 java.io.IOException
 
- 
merge
public void merge(MergeState mergeState, FieldInfo.IndexOptions indexOptions, TermsEnum termsEnum) throws java.io.IOException
Default merge impl- Throws:
 java.io.IOException
 
 - 
 
 -