Show / Hide Table of Contents

    Class TermContext

    Maintains a IndexReader TermState view over IndexReader instances containing a single term. The TermContext doesn't track if the given TermState objects are valid, neither if the TermState instances refer to the same terms in the associated readers.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    TermContext
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class TermContext : object

    Constructors

    | Improve this Doc View Source

    TermContext(IndexReaderContext)

    Creates an empty TermContext from a IndexReaderContext

    Declaration
    public TermContext(IndexReaderContext context)
    Parameters
    Type Name Description
    IndexReaderContext context
    | Improve this Doc View Source

    TermContext(IndexReaderContext, TermState, Int32, Int32, Int64)

    Creates a TermContext with an initial TermState, IndexReader pair.

    Declaration
    public TermContext(IndexReaderContext context, TermState state, int ord, int docFreq, long totalTermFreq)
    Parameters
    Type Name Description
    IndexReaderContext context
    TermState state
    System.Int32 ord
    System.Int32 docFreq
    System.Int64 totalTermFreq

    Properties

    | Improve this Doc View Source

    DocFreq

    expert: only available for queries that want to lie about docfreq

    This is a Lucene.NET INTERNAL API, use at your own risk
    Declaration
    public int DocFreq { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    TopReaderContext

    Holds the IndexReaderContext of the top-level IndexReader, used internally only for asserting.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Declaration
    public IndexReaderContext TopReaderContext { get; }
    Property Value
    Type Description
    IndexReaderContext
    | Improve this Doc View Source

    TotalTermFreq

    Returns the accumulated term frequency of all TermState instances passed to Register(TermState, Int32, Int32, Int64).

    Declaration
    public long TotalTermFreq { get; }
    Property Value
    Type Description
    System.Int64

    the accumulated term frequency of all TermState instances passed to Register(TermState, Int32, Int32, Int64).

    Methods

    | Improve this Doc View Source

    Build(IndexReaderContext, Term)

    Creates a TermContext from a top-level IndexReaderContext and the given Term. this method will lookup the given term in all context's leaf readers and register each of the readers containing the term in the returned TermContext using the leaf reader's ordinal.

    Note: the given context must be a top-level context.

    Declaration
    public static TermContext Build(IndexReaderContext context, Term term)
    Parameters
    Type Name Description
    IndexReaderContext context
    Term term
    Returns
    Type Description
    TermContext
    | Improve this Doc View Source

    Clear()

    Clears the TermContext internal state and removes all registered TermStates

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Get(Int32)

    Returns the TermState for an leaf ordinal or null if no TermState for the ordinal was registered.

    Declaration
    public TermState Get(int ord)
    Parameters
    Type Name Description
    System.Int32 ord

    The readers leaf ordinal to get the TermState for.

    Returns
    Type Description
    TermState

    The TermState for the given readers ord or null if no TermState for the reader was registered

    | Improve this Doc View Source

    Register(TermState, Int32, Int32, Int64)

    Registers and associates a TermState with an leaf ordinal. The leaf ordinal should be derived from a IndexReaderContext's leaf ord.

    Declaration
    public void Register(TermState state, int ord, int docFreq, long totalTermFreq)
    Parameters
    Type Name Description
    TermState state
    System.Int32 ord
    System.Int32 docFreq
    System.Int64 totalTermFreq
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)