• API

    Show / Hide Table of Contents

    Class AtomicReader

    AtomicReader is an abstract class, providing an interface for accessing an index. Search of an index is done entirely through this abstract interface, so that any subclass which implements it is searchable. IndexReaders implemented by this subclass do not consist of several sub-readers, they are atomic. They support retrieval of stored fields, doc values, terms, and postings.

    For efficiency, in this API documents are often referred to via document numbers, non-negative integers which each name a unique document in the index. These document numbers are ephemeral -- they may change as documents are added to and deleted from an index. Clients should thus not rely on a given document having the same number between sessions.

    NOTE: IndexReader instances are completely thread safe, meaning multiple threads can call any of its methods, concurrently. If your application requires external synchronization, you should not synchronize on the IndexReader instance; use your own (non-Lucene) objects instead.

    Inheritance
    System.Object
    IndexReader
    AtomicReader
    FilterAtomicReader
    ParallelAtomicReader
    SegmentReader
    SlowCompositeReaderWrapper
    Implements
    System.IDisposable
    Inherited Members
    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.GetTermVectors(Int32)
    IndexReader.GetTermVector(Int32, String)
    IndexReader.NumDocs
    IndexReader.MaxDoc
    IndexReader.NumDeletedDocs
    IndexReader.Document(Int32, StoredFieldVisitor)
    IndexReader.Document(Int32)
    IndexReader.Document(Int32, ISet<String>)
    IndexReader.HasDeletions
    IndexReader.Dispose()
    IndexReader.Dispose(Boolean)
    IndexReader.DoClose()
    IndexReader.Leaves
    IndexReader.CoreCacheKey
    IndexReader.CombinedCoreAndDeletesKey
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class AtomicReader : IndexReader, IDisposable

    Constructors

    | Improve this Doc View Source

    AtomicReader()

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

    Declaration
    protected AtomicReader()

    Properties

    | Improve this Doc View Source

    AtomicContext

    LUCENENET specific propety that allows access to the context as AtomicReaderContext, which prevents the need to cast.

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

    Context

    Declaration
    public override sealed IndexReaderContext Context { get; }
    Property Value
    Type Description
    IndexReaderContext
    Overrides
    IndexReader.Context
    | Improve this Doc View Source

    FieldInfos

    Get the FieldInfos describing all fields in this reader.

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

    Fields

    Returns Fields for this reader. this property may return null if the reader has no postings.

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

    LiveDocs

    Returns the IBits representing live (not deleted) docs. A set bit indicates the doc ID has not been deleted. If this method returns null it means there are no deleted documents (all documents are live).

    The returned instance has been safely published for use by multiple threads without additional synchronization.

    Declaration
    public abstract IBits LiveDocs { get; }
    Property Value
    Type Description
    IBits

    Methods

    | Improve this Doc View Source

    CheckIntegrity()

    Checks consistency of this reader.

    Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Declaration
    public abstract void CheckIntegrity()
    | Improve this Doc View Source

    DocFreq(Term)

    Declaration
    public override sealed int DocFreq(Term term)
    Parameters
    Type Name Description
    Term term
    Returns
    Type Description
    System.Int32
    Overrides
    IndexReader.DocFreq(Term)
    | Improve this Doc View Source

    GetBinaryDocValues(String)

    Returns BinaryDocValues for this field, or null if no BinaryDocValues were indexed for this field. The returned instance should only be used by a single thread.

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

    GetDocCount(String)

    Declaration
    public override sealed int GetDocCount(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    System.Int32
    Overrides
    IndexReader.GetDocCount(String)
    | Improve this Doc View Source

    GetDocsWithField(String)

    Returns a IBits at the size of reader.MaxDoc, with turned on bits for each docid that does have a value for this field, or null if no DocValues were indexed for this field. The returned instance should only be used by a single thread.

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

    GetNormValues(String)

    Returns NumericDocValues representing norms for this field, or null if no NumericDocValues were indexed. The returned instance should only be used by a single thread.

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

    GetNumericDocValues(String)

    Returns NumericDocValues for this field, or null if no NumericDocValues were indexed for this field. The returned instance should only be used by a single thread.

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

    GetSortedDocValues(String)

    Returns SortedDocValues for this field, or null if no SortedDocValues were indexed for this field. The returned instance should only be used by a single thread.

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

    GetSortedSetDocValues(String)

    Returns SortedSetDocValues for this field, or null if no SortedSetDocValues were indexed for this field. The returned instance should only be used by a single thread.

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

    GetSumDocFreq(String)

    Declaration
    public override sealed long GetSumDocFreq(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    System.Int64
    Overrides
    IndexReader.GetSumDocFreq(String)
    | Improve this Doc View Source

    GetSumTotalTermFreq(String)

    Declaration
    public override sealed long GetSumTotalTermFreq(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    System.Int64
    Overrides
    IndexReader.GetSumTotalTermFreq(String)
    | Improve this Doc View Source

    GetTermDocsEnum(Term)

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

    Declaration
    public DocsEnum GetTermDocsEnum(Term term)
    Parameters
    Type Name Description
    Term term
    Returns
    Type Description
    DocsEnum
    See Also
    Docs(IBits, DocsEnum)
    | Improve this Doc View Source

    GetTermPositionsEnum(Term)

    Returns DocsAndPositionsEnum for the specified term. This will return null if the field or term does not exist or positions weren't indexed.

    Declaration
    public DocsAndPositionsEnum GetTermPositionsEnum(Term term)
    Parameters
    Type Name Description
    Term term
    Returns
    Type Description
    DocsAndPositionsEnum
    See Also
    DocsAndPositions(IBits, DocsAndPositionsEnum)
    | Improve this Doc View Source

    GetTerms(String)

    This may return null if the field does not exist.

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

    HasNorms(String)

    Returns true if there are norms stored for this field.

    Declaration
    [Obsolete("(4.0) use FieldInfos and check FieldInfo.HasNorms for the field instead.")]
    public bool HasNorms(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    TotalTermFreq(Term)

    Returns the number of documents containing the term. This method returns 0 if the term or field does not exist. This method does not take into account deleted documents that have not yet been merged away.

    Declaration
    public override sealed long TotalTermFreq(Term term)
    Parameters
    Type Name Description
    Term term
    Returns
    Type Description
    System.Int64
    Overrides
    IndexReader.TotalTermFreq(Term)

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)