Show / Hide Table of Contents

    Class MultiFields

    Exposes flex API, merged from flex API of sub-segments. This is useful when you're interacting with an IndexReader implementation that consists of sequential sub-readers (eg DirectoryReader or MultiReader).

    NOTE: for composite readers, you'll get better performance by gathering the sub readers using Context to get the atomic leaves and then operate per-AtomicReader, instead of using this class.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    Fields
    MultiFields
    Inherited Members
    Fields.UniqueTermCount
    Fields.EMPTY_ARRAY
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class MultiFields : Fields

    Constructors

    | Improve this Doc View Source

    MultiFields(Fields[], ReaderSlice[])

    Expert: construct a new MultiFields instance directly.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Declaration
    public MultiFields(Fields[] subs, ReaderSlice[] subSlices)
    Parameters
    Type Name Description
    Fields[] subs
    ReaderSlice[] subSlices

    Properties

    | Improve this Doc View Source

    Count

    Declaration
    public override int Count { get; }
    Property Value
    Type Description
    System.Int32
    Overrides
    Fields.Count

    Methods

    | Improve this Doc View Source

    GetEnumerator()

    Declaration
    public override IEnumerator<string> GetEnumerator()
    Returns
    Type Description
    IEnumerator<System.String>
    Overrides
    Fields.GetEnumerator()
    | Improve this Doc View Source

    GetFields(IndexReader)

    Returns a single Fields instance for this reader, merging fields/terms/docs/positions on the fly. This method will return null if the reader has no postings.

    NOTE: this is a slow way to access postings. It's better to get the sub-readers and iterate through them yourself.

    Declaration
    public static Fields GetFields(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    Fields
    | Improve this Doc View Source

    GetIndexedFields(IndexReader)

    Call this to get the (merged) FieldInfos representing the set of indexed fields only for a composite reader.

    NOTE: the returned field numbers will likely not correspond to the actual field numbers in the underlying readers, and codec metadata (GetAttribute(String)) will be unavailable.

    Declaration
    public static ICollection<string> GetIndexedFields(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    ICollection<System.String>
    | Improve this Doc View Source

    GetLiveDocs(IndexReader)

    Returns a single IBits instance for this reader, merging live Documents on the fly. This method will return null if the reader has no deletions.

    NOTE: this is a very slow way to access live docs. For example, each IBits access will require a binary search. It's better to get the sub-readers and iterate through them yourself.

    Declaration
    public static IBits GetLiveDocs(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    IBits
    | Improve this Doc View Source

    GetMergedFieldInfos(IndexReader)

    Call this to get the (merged) FieldInfos for a composite reader.

    NOTE: the returned field numbers will likely not correspond to the actual field numbers in the underlying readers, and codec metadata (GetAttribute(String)) will be unavailable.

    Declaration
    public static FieldInfos GetMergedFieldInfos(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    FieldInfos
    | Improve this Doc View Source

    GetTermDocsEnum(IndexReader, IBits, String, BytesRef)

    Returns DocsEnum for the specified field & term. This will return null if the field or term does not exist.

    Declaration
    public static DocsEnum GetTermDocsEnum(IndexReader r, IBits liveDocs, string field, BytesRef term)
    Parameters
    Type Name Description
    IndexReader r
    IBits liveDocs
    System.String field
    BytesRef term
    Returns
    Type Description
    DocsEnum
    | Improve this Doc View Source

    GetTermDocsEnum(IndexReader, IBits, String, BytesRef, DocsFlags)

    Returns DocsEnum for the specified field & term, with control over whether freqs are required. Some codecs may be able to optimize their implementation when freqs are not required. This will return null if the field or term does not exist. See Docs(IBits, DocsEnum, DocsFlags).

    Declaration
    public static DocsEnum GetTermDocsEnum(IndexReader r, IBits liveDocs, string field, BytesRef term, DocsFlags flags)
    Parameters
    Type Name Description
    IndexReader r
    IBits liveDocs
    System.String field
    BytesRef term
    DocsFlags flags
    Returns
    Type Description
    DocsEnum
    | Improve this Doc View Source

    GetTermPositionsEnum(IndexReader, IBits, String, BytesRef)

    Returns DocsAndPositionsEnum for the specified field & term. This will return null if the field or term does not exist or positions were not indexed.

    Declaration
    public static DocsAndPositionsEnum GetTermPositionsEnum(IndexReader r, IBits liveDocs, string field, BytesRef term)
    Parameters
    Type Name Description
    IndexReader r
    IBits liveDocs
    System.String field
    BytesRef term
    Returns
    Type Description
    DocsAndPositionsEnum
    See Also
    GetTermPositionsEnum(IndexReader, IBits, String, BytesRef, DocsAndPositionsFlags)
    | Improve this Doc View Source

    GetTermPositionsEnum(IndexReader, IBits, String, BytesRef, DocsAndPositionsFlags)

    Returns DocsAndPositionsEnum for the specified field & term, with control over whether offsets and payloads are required. Some codecs may be able to optimize their implementation when offsets and/or payloads are not required. This will return null if the field or term does not exist or positions were not indexed. See DocsAndPositions(IBits, DocsAndPositionsEnum, DocsAndPositionsFlags).

    Declaration
    public static DocsAndPositionsEnum GetTermPositionsEnum(IndexReader r, IBits liveDocs, string field, BytesRef term, DocsAndPositionsFlags flags)
    Parameters
    Type Name Description
    IndexReader r
    IBits liveDocs
    System.String field
    BytesRef term
    DocsAndPositionsFlags flags
    Returns
    Type Description
    DocsAndPositionsEnum
    | Improve this Doc View Source

    GetTerms(IndexReader, String)

    this method may return null if the field does not exist.

    Declaration
    public static Terms GetTerms(IndexReader r, string field)
    Parameters
    Type Name Description
    IndexReader r
    System.String field
    Returns
    Type Description
    Terms
    | Improve this Doc View Source

    GetTerms(String)

    Declaration
    public override Terms GetTerms(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    Terms
    Overrides
    Fields.GetTerms(String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)