Class TermsConsumer
Abstract API that consumes terms for an individual field.
The lifecycle is:
- TermsConsumer is returned for each field by AddField(FieldInfo).
- TermsConsumer returns a PostingsConsumer for each term in StartTerm(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(Int64, Int64, Int32) with the accumulated collection statistics when it is finished adding terms to the field.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
System.Object
TermsConsumer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Codecs
Assembly: Lucene.Net.dll
Syntax
public abstract class TermsConsumer
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 |
|---|---|
| System.Collections.Generic.IComparer<BytesRef> |
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.Int64 | sumTotalTermFreq | |
| System.Int64 | sumDocFreq | |
| System.Int32 | 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
| Type | Name | Description |
|---|---|---|
| BytesRef | text | |
| TermStats | stats |
Merge(MergeState, IndexOptions, TermsEnum)
Default merge impl.
Declaration
public virtual void Merge(MergeState mergeState, IndexOptions indexOptions, TermsEnum termsEnum)
Parameters
| Type | Name | Description |
|---|---|---|
| MergeState | mergeState | |
| IndexOptions | indexOptions | |
| TermsEnum | 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 |
|---|---|---|
| BytesRef | text |
Returns
| Type | Description |
|---|---|
| PostingsConsumer |