Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BaseCompositeReader<R>

    Base class for implementing CompositeReaders based on an array of sub-readers. The implementing class has to add code for correctly refcounting and closing the sub-readers.

    User code will most likely use MultiReader to build a composite reader on a set of sub-readers (like several DirectoryReaders).

    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.

    Note

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

    Inheritance
    System.Object
    IndexReader
    CompositeReader
    BaseCompositeReader<R>
    DirectoryReader
    MultiReader
    ParallelCompositeReader
    Implements
    System.IDisposable
    Inherited Members
    CompositeReader.ToString()
    CompositeReader.Context
    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.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)
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class BaseCompositeReader<R> : CompositeReader, IDisposable where R : IndexReader
    Type Parameters
    Name Description
    R

    Constructors

    | Improve this Doc View Source

    BaseCompositeReader(R[])

    Constructs a BaseCompositeReader<R> on the given subReaders.

    Declaration
    protected BaseCompositeReader(R[] subReaders)
    Parameters
    Type Name Description
    R[] subReaders

    the wrapped sub-readers. This array is returned by GetSequentialSubReaders() and used to resolve the correct subreader for docID-based methods. Please note: this array is not cloned and not protected for modification, the subclass is responsible to do this.

    Properties

    | Improve this Doc View Source

    MaxDoc

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

    NumDocs

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

    Methods

    | Improve this Doc View Source

    DocFreq(Term)

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

    Document(Int32, StoredFieldVisitor)

    Declaration
    public sealed 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

    GetDocCount(String)

    Declaration
    public sealed override 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

    GetSequentialSubReaders()

    Declaration
    protected sealed override IList<IndexReader> GetSequentialSubReaders()
    Returns
    Type Description
    System.Collections.Generic.IList<IndexReader>
    Overrides
    CompositeReader.GetSequentialSubReaders()
    | Improve this Doc View Source

    GetSumDocFreq(String)

    Declaration
    public sealed override 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 sealed override 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

    GetTermVectors(Int32)

    Declaration
    public sealed 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

    ReaderBase(Int32)

    Helper method for subclasses to get the docBase of the given sub-reader index.

    Declaration
    protected int ReaderBase(int readerIndex)
    Parameters
    Type Name Description
    System.Int32 readerIndex
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    ReaderIndex(Int32)

    Helper method for subclasses to get the corresponding reader for a doc ID

    Declaration
    protected int ReaderIndex(int docID)
    Parameters
    Type Name Description
    System.Int32 docID
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    TotalTermFreq(Term)

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

    Implements

    System.IDisposable

    See Also

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