Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SegmentReader

    IndexReader implementation over a single segment.

    Instances pointing to the same segment (but with different deletes, etc) may share the same core data.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    System.Object
    IndexReader
    AtomicReader
    SegmentReader
    Implements
    System.IDisposable
    Inherited Members
    AtomicReader.Context
    AtomicReader.AtomicContext
    AtomicReader.HasNorms(String)
    AtomicReader.DocFreq(Term)
    AtomicReader.TotalTermFreq(Term)
    AtomicReader.GetSumDocFreq(String)
    AtomicReader.GetDocCount(String)
    AtomicReader.GetSumTotalTermFreq(String)
    AtomicReader.GetTerms(String)
    AtomicReader.GetTermDocsEnum(Term)
    AtomicReader.GetTermPositionsEnum(Term)
    IndexReader.AddReaderClosedListener(IndexReader.IReaderClosedListener)
    IndexReader.RemoveReaderClosedListener(IndexReader.IReaderClosedListener)
    IndexReader.RegisterParentReader(IndexReader)
    IndexReader.RefCount
    IndexReader.IncRef()
    IndexReader.TryIncRef()
    IndexReader.DecRef()
    IndexReader.EnsureOpen()
    IndexReader.Equals(Object)
    IndexReader.GetHashCode()
    IndexReader.Open(Directory)
    IndexReader.Open(Directory, Int32)
    IndexReader.Open(IndexWriter, Boolean)
    IndexReader.Open(IndexCommit)
    IndexReader.Open(IndexCommit, Int32)
    IndexReader.GetTermVector(Int32, String)
    IndexReader.NumDeletedDocs
    IndexReader.Document(Int32)
    IndexReader.Document(Int32, ISet<String>)
    IndexReader.HasDeletions
    IndexReader.Dispose()
    IndexReader.Dispose(Boolean)
    IndexReader.Leaves
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class SegmentReader : AtomicReader, IDisposable

    Constructors

    | Improve this Doc View Source

    SegmentReader(SegmentCommitInfo, Int32, IOContext)

    Constructs a new SegmentReader with a new core.

    Declaration
    public SegmentReader(SegmentCommitInfo si, int termInfosIndexDivisor, IOContext context)
    Parameters
    Type Name Description
    SegmentCommitInfo si
    System.Int32 termInfosIndexDivisor
    IOContext context
    Exceptions
    Type Condition
    CorruptIndexException

    if the index is corrupt

    System.IO.IOException

    if there is a low-level IO error

    Properties

    | Improve this Doc View Source

    CombinedCoreAndDeletesKey

    Declaration
    public override object CombinedCoreAndDeletesKey { get; }
    Property Value
    Type Description
    System.Object
    Overrides
    IndexReader.CombinedCoreAndDeletesKey
    | Improve this Doc View Source

    CoreCacheKey

    Declaration
    public override object CoreCacheKey { get; }
    Property Value
    Type Description
    System.Object
    Overrides
    IndexReader.CoreCacheKey
    | Improve this Doc View Source

    Directory

    Returns the directory this index resides in.

    Declaration
    public Directory Directory { get; }
    Property Value
    Type Description
    Directory
    | Improve this Doc View Source

    FieldInfos

    Declaration
    public override FieldInfos FieldInfos { get; }
    Property Value
    Type Description
    FieldInfos
    Overrides
    AtomicReader.FieldInfos
    | Improve this Doc View Source

    Fields

    Declaration
    public override Fields Fields { get; }
    Property Value
    Type Description
    Fields
    Overrides
    AtomicReader.Fields
    | Improve this Doc View Source

    FieldsReader

    Expert: retrieve thread-private StoredFieldsReader

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public StoredFieldsReader FieldsReader { get; }
    Property Value
    Type Description
    StoredFieldsReader
    | Improve this Doc View Source

    LiveDocs

    Declaration
    public override IBits LiveDocs { get; }
    Property Value
    Type Description
    IBits
    Overrides
    AtomicReader.LiveDocs
    | Improve this Doc View Source

    MaxDoc

    Declaration
    public override int MaxDoc { get; }
    Property Value
    Type Description
    System.Int32
    Overrides
    IndexReader.MaxDoc
    | Improve this Doc View Source

    NumDocs

    Declaration
    public override int NumDocs { get; }
    Property Value
    Type Description
    System.Int32
    Overrides
    IndexReader.NumDocs
    | Improve this Doc View Source

    SegmentInfo

    Return the SegmentCommitInfo of the segment this reader is reading.

    Declaration
    public SegmentCommitInfo SegmentInfo { get; }
    Property Value
    Type Description
    SegmentCommitInfo
    | Improve this Doc View Source

    SegmentName

    Return the name of the segment this reader is reading.

    Declaration
    public string SegmentName { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    TermInfosIndexDivisor

    Returns term infos index divisor originally passed to SegmentReader(SegmentCommitInfo, Int32, IOContext).

    Declaration
    public int TermInfosIndexDivisor { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    TermVectorsReader

    Expert: retrieve thread-private TermVectorsReader

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public TermVectorsReader TermVectorsReader { get; }
    Property Value
    Type Description
    TermVectorsReader

    Methods

    | Improve this Doc View Source

    AddCoreDisposedListener(SegmentReader.ICoreDisposedListener)

    Expert: adds a SegmentReader.ICoreDisposedListener to this reader's shared core

    Declaration
    public void AddCoreDisposedListener(SegmentReader.ICoreDisposedListener listener)
    Parameters
    Type Name Description
    SegmentReader.ICoreDisposedListener listener
    | Improve this Doc View Source

    CheckIntegrity()

    Declaration
    public override void CheckIntegrity()
    Overrides
    AtomicReader.CheckIntegrity()
    | Improve this Doc View Source

    DoClose()

    Declaration
    protected override void DoClose()
    Overrides
    IndexReader.DoClose()
    | Improve this Doc View Source

    Document(Int32, StoredFieldVisitor)

    Declaration
    public override void Document(int docID, StoredFieldVisitor visitor)
    Parameters
    Type Name Description
    System.Int32 docID
    StoredFieldVisitor visitor
    Overrides
    IndexReader.Document(Int32, StoredFieldVisitor)
    | Improve this Doc View Source

    GetBinaryDocValues(String)

    Declaration
    public override BinaryDocValues GetBinaryDocValues(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    BinaryDocValues
    Overrides
    AtomicReader.GetBinaryDocValues(String)
    | Improve this Doc View Source

    GetDocsWithField(String)

    Declaration
    public override IBits GetDocsWithField(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    IBits
    Overrides
    AtomicReader.GetDocsWithField(String)
    | Improve this Doc View Source

    GetNormValues(String)

    Declaration
    public override NumericDocValues GetNormValues(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    NumericDocValues
    Overrides
    AtomicReader.GetNormValues(String)
    | Improve this Doc View Source

    GetNumericDocValues(String)

    Declaration
    public override NumericDocValues GetNumericDocValues(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    NumericDocValues
    Overrides
    AtomicReader.GetNumericDocValues(String)
    | Improve this Doc View Source

    GetSortedDocValues(String)

    Declaration
    public override SortedDocValues GetSortedDocValues(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    SortedDocValues
    Overrides
    AtomicReader.GetSortedDocValues(String)
    | Improve this Doc View Source

    GetSortedSetDocValues(String)

    Declaration
    public override SortedSetDocValues GetSortedSetDocValues(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    SortedSetDocValues
    Overrides
    AtomicReader.GetSortedSetDocValues(String)
    | Improve this Doc View Source

    GetTermVectors(Int32)

    Declaration
    public override Fields GetTermVectors(int docID)
    Parameters
    Type Name Description
    System.Int32 docID
    Returns
    Type Description
    Fields
    Overrides
    IndexReader.GetTermVectors(Int32)
    | Improve this Doc View Source

    RamBytesUsed()

    Returns approximate RAM Bytes used

    Declaration
    public long RamBytesUsed()
    Returns
    Type Description
    System.Int64
    | Improve this Doc View Source

    RemoveCoreDisposedListener(SegmentReader.ICoreDisposedListener)

    Expert: removes a SegmentReader.ICoreDisposedListener from this reader's shared core

    Declaration
    public void RemoveCoreDisposedListener(SegmentReader.ICoreDisposedListener listener)
    Parameters
    Type Name Description
    SegmentReader.ICoreDisposedListener listener
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2022 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.