Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class TermsConsumer

    Abstract API that consumes terms for an individual field.

    The lifecycle is:
    1. TermsConsumer is returned for each field by AddField(FieldInfo).
    2. TermsConsumer returns a PostingsConsumer for each term in StartTerm(BytesRef).
    3. When the producer (e.g. IndexWriter) is done adding documents for the term, it calls FinishTerm(BytesRef, TermStats), passing in the accumulated term statistics.
    4. Producer calls Finish(long, long, int) 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
    object
    TermsConsumer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Codecs
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class TermsConsumer

    Constructors

    TermsConsumer()

    Sole constructor. (For invocation by subclass constructors, typically implicit.)

    Declaration
    protected TermsConsumer()

    Properties

    Comparer

    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<BytesRef>

    Methods

    Finish(long, long, int)

    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
    long sumTotalTermFreq
    long sumDocFreq
    int 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
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.