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(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 Source

    TermsConsumer()

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

    Declaration
    protected TermsConsumer()

    Properties

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    Finish(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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)