Class TermsConsumer
Abstract API that consumes terms for an individual field.
The lifecycle is:
- TermsConsumer is returned for each field
by Add
Field(Field .Info) - TermsConsumer returns a Postings
Consumer for each term in StartTerm(Bytes .Ref) - When the producer (e.g. IndexWriter)
is done adding documents for the term, it calls
Finish
Term(Bytes , passing in the accumulated term statistics.Ref, Term Stats) - Producer calls Finish(Int64, Int64, Int32) with the accumulated collection statistics when it is finished adding terms to the field.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inheritance
System.Object
TermsConsumer
Namespace: Lucene.Net.Codecs
Assembly: Lucene.Net.dll
Syntax
public abstract class TermsConsumer : object
Constructors
| Improve this Doc View SourceTermsConsumer()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
protected TermsConsumer()
Properties
| Improve this Doc View SourceComparer
Gets the IComparer<BytesRef> used to sort terms before feeding to this API.
Declaration
public abstract IComparer<BytesRef> Comparer { get; }
Property Value
Type | Description |
---|---|
IComparer<Bytes |
Methods
| Improve this Doc View SourceFinish(Int64, Int64, Int32)
Called when we are done adding terms to this field.
sumTotalTermFreq
will be -1 when term
frequencies are omitted for the field.
Declaration
public abstract void Finish(long sumTotalTermFreq, long sumDocFreq, int docCount)
Parameters
Type | Name | Description |
---|---|---|
System. |
sumTotalTermFreq | |
System. |
sumDocFreq | |
System. |
docCount |
FinishTerm(BytesRef, TermStats)
Finishes the current term; numDocs must be > 0.
stats.TotalTermFreq
will be -1 when term
frequencies are omitted for the field.
Declaration
public abstract void FinishTerm(BytesRef text, TermStats stats)
Parameters
| Improve this Doc View SourceMerge(MergeState, IndexOptions, TermsEnum)
Default merge impl.
Declaration
public virtual void Merge(MergeState mergeState, IndexOptions indexOptions, TermsEnum termsEnum)
Parameters
Type | Name | Description |
---|---|---|
Merge |
mergeState | |
Index |
indexOptions | |
Terms |
termsEnum |
StartTerm(BytesRef)
Starts a new term in this field; this may be called with no corresponding call to finish if the term had no docs.
Declaration
public abstract PostingsConsumer StartTerm(BytesRef text)
Parameters
Type | Name | Description |
---|---|---|
Bytes |
text |
Returns
Type | Description |
---|---|
Postings |