Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class FilterAtomicReader

    A FilterAtomicReader contains another AtomicReader, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality. The class FilterAtomicReader itself simply implements all abstract methods of IndexReader with versions that pass all requests to the contained index reader. Subclasses of FilterAtomicReader may further override some of these methods and may also provide additional methods and fields.

    NOTE: If you override LiveDocs, you will likely need to override NumDocs as well and vice-versa.

    NOTE: If this FilterAtomicReader does not change the content the contained reader, you could consider overriding CoreCacheKey so that IFieldCache and CachingWrapperFilter share the same entries for this atomic reader and the wrapped one. CombinedCoreAndDeletesKey could be overridden as well if the LiveDocs are not changed either.
    Inheritance
    object
    IndexReader
    AtomicReader
    FilterAtomicReader
    Implements
    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.AddReaderDisposedListener(IReaderDisposedListener)
    IndexReader.RemoveReaderDisposedListener(IReaderDisposedListener)
    IndexReader.RegisterParentReader(IndexReader)
    IndexReader.RefCount
    IndexReader.IncRef()
    IndexReader.TryIncRef()
    IndexReader.DecRef()
    IndexReader.EnsureOpen()
    IndexReader.Equals(object)
    IndexReader.GetHashCode()
    IndexReader.Open(Directory)
    IndexReader.Open(Directory, int)
    IndexReader.Open(IndexWriter, bool)
    IndexReader.Open(IndexCommit)
    IndexReader.Open(IndexCommit, int)
    IndexReader.GetTermVector(int, string)
    IndexReader.NumDeletedDocs
    IndexReader.Document(int)
    IndexReader.Document(int, ISet<string>)
    IndexReader.HasDeletions
    IndexReader.Dispose()
    IndexReader.Dispose(bool)
    IndexReader.Leaves
    IndexReader.CoreCacheKey
    IndexReader.CombinedCoreAndDeletesKey
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public class FilterAtomicReader : AtomicReader, IDisposable

    Constructors

    FilterAtomicReader(AtomicReader)

    Construct a FilterAtomicReader based on the specified base reader.

    Note that base reader is closed if this FilterAtomicReader is closed.
    Declaration
    public FilterAtomicReader(AtomicReader input)
    Parameters
    Type Name Description
    AtomicReader input

    specified base reader.

    Fields

    m_input

    The underlying AtomicReader.

    Declaration
    protected readonly AtomicReader m_input
    Field Value
    Type Description
    AtomicReader

    Properties

    FieldInfos

    Get the FieldInfos describing all fields in this reader.

    Note

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

    Declaration
    public override FieldInfos FieldInfos { get; }
    Property Value
    Type Description
    FieldInfos
    Overrides
    AtomicReader.FieldInfos

    Fields

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

    Declaration
    public override Fields Fields { get; }
    Property Value
    Type Description
    Fields
    Overrides
    AtomicReader.Fields

    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 override IBits LiveDocs { get; }
    Property Value
    Type Description
    IBits
    Overrides
    AtomicReader.LiveDocs

    MaxDoc

    Returns one greater than the largest possible document number. this may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.

    Declaration
    public override int MaxDoc { get; }
    Property Value
    Type Description
    int
    Overrides
    IndexReader.MaxDoc

    NumDocs

    Returns the number of documents in this index.

    Declaration
    public override int NumDocs { get; }
    Property Value
    Type Description
    int
    Overrides
    IndexReader.NumDocs

    Methods

    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.

    Note

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

    Declaration
    public override void CheckIntegrity()
    Overrides
    AtomicReader.CheckIntegrity()

    DoClose()

    Implements close.

    Declaration
    protected override void DoClose()
    Overrides
    IndexReader.DoClose()

    Document(int, StoredFieldVisitor)

    Expert: visits the fields of a stored document, for custom processing/loading of each field. If you simply want to load all fields, use Document(int). If you want to load a subset, use DocumentStoredFieldVisitor.

    Declaration
    public override void Document(int docID, StoredFieldVisitor visitor)
    Parameters
    Type Name Description
    int docID
    StoredFieldVisitor visitor
    Overrides
    IndexReader.Document(int, StoredFieldVisitor)

    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 override BinaryDocValues GetBinaryDocValues(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    BinaryDocValues
    Overrides
    AtomicReader.GetBinaryDocValues(string)

    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 override IBits GetDocsWithField(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    IBits
    Overrides
    AtomicReader.GetDocsWithField(string)

    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 override NumericDocValues GetNormValues(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    NumericDocValues
    Overrides
    AtomicReader.GetNormValues(string)

    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 override NumericDocValues GetNumericDocValues(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    NumericDocValues
    Overrides
    AtomicReader.GetNumericDocValues(string)

    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 override SortedDocValues GetSortedDocValues(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    SortedDocValues
    Overrides
    AtomicReader.GetSortedDocValues(string)

    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 override SortedSetDocValues GetSortedSetDocValues(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    SortedSetDocValues
    Overrides
    AtomicReader.GetSortedSetDocValues(string)

    GetTermVectors(int)

    Retrieve term vectors for this document, or null if term vectors were not indexed. The returned Fields instance acts like a single-document inverted index (the docID will be 0).

    Declaration
    public override Fields GetTermVectors(int docID)
    Parameters
    Type Name Description
    int docID
    Returns
    Type Description
    Fields
    Overrides
    IndexReader.GetTermVectors(int)

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    Overrides
    object.ToString()

    Unwrap(AtomicReader)

    Get the wrapped instance by reader as long as this reader is an intance of FilterAtomicReader.

    Declaration
    public static AtomicReader Unwrap(AtomicReader reader)
    Parameters
    Type Name Description
    AtomicReader reader
    Returns
    Type Description
    AtomicReader

    Implements

    IDisposable
    Back to top Copyright © 2024 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.