jruby/docs BETA
Navigation
org.apache.lucene.index 131
C AutomatonTermsEnum
C BaseCompositeReader
C BaseTermsEnum
C BinaryDocValues
C ByteVectorValues
C CheckIndex
C CodecReader
C CompositeReader
C CompositeReaderContext
C ConcurrentMergeScheduler
C CorruptIndexException
C DirectoryReader
C DocIDMerger
C DocValues
E DocValuesSkipIndexType
C DocValuesSkipper
E DocValuesType
C DocsWithFieldSet
C EmptyDocValuesProducer
C ExitableDirectoryReader
C FieldInfo
C FieldInfos
C FieldInvertState
C Fields
C FilterBinaryDocValues
C FilterCodecReader
C FilterDirectoryReader
C FilterLeafReader
C FilterMergePolicy
C FilterNumericDocValues
C FilterSortedDocValues
C FilterSortedNumericDocValues
C FilterSortedSetDocValues
C FilteredTermsEnum
C FloatVectorValues
C FreqAndNormBuffer
C Impacts
C ImpactsEnum
I ImpactsSource
C IndexCommit
C IndexDeletionPolicy
C IndexFileNames
C IndexFormatTooNewException
C IndexFormatTooOldException
C IndexNotFoundException
E IndexOptions
C IndexReader
C IndexReaderContext
I IndexSorter
C IndexUpgrader
C IndexWriter
C IndexWriterConfig
I IndexWriterEventListener
I IndexableField
I IndexableFieldType
C KeepLastNCommitsDeletionPolicy
C KeepOnlyLastCommitDeletionPolicy
C KnnVectorValues
C LeafReader
C LeafReaderContext
C LiveIndexWriterConfig
C LogByteSizeMergePolicy
C LogDocMergePolicy
C LogMergePolicy
C MappedMultiFields
C MergePolicy
C MergeRateLimiter
C MergeScheduler
C MergeState
E MergeTrigger
C MultiBits
C MultiDocValues
C MultiFields
C MultiLeafReader
C MultiPostingsEnum
C MultiReader
C MultiTerms
C MultiTermsEnum
C NoDeletionPolicy
C NoMergePolicy
C NoMergeScheduler
C NumericDocValues
C OneMergeWrappingMergePolicy
C OrdTermState
C OrdinalMap
C ParallelCompositeReader
C ParallelLeafReader
C PersistentSnapshotDeletionPolicy
C PointValues
C PostingsEnum
C PrefixCodedTerms
I QueryTimeout
C QueryTimeoutImpl
C ReaderManager
C ReaderUtil
C SegmentCommitInfo
C SegmentInfo
C SegmentInfos
C SegmentOrder
C SegmentReadState
C SegmentReader
C SegmentWriteState
C SerialMergeScheduler
C SimpleMergedSegmentWarmer
C SingleTermsEnum
C SlowCodecReaderWrapper
C SlowImpactsEnum
C SnapshotDeletionPolicy
C SoftDeletesDirectoryReaderWrapper
C SoftDeletesRetentionMergePolicy
C SortFieldProvider
C SortedDocValues
C SortedNumericDocValues
C SortedSetDocValues
C Sorter
C SortingCodecReader
C StandardDirectoryReader
C StoredFieldVisitor
C StoredFields
C Term
C TermState
C TermStates
C TermVectors
C Terms
C TermsEnum
C TieredMergePolicy
I TwoPhaseCommit
C TwoPhaseCommitTool
C UpgradeIndexMergePolicy
E VectorEncoding
E VectorSimilarityFunction
MultiReader — members 4+
C new(sub_readers)
C new(sub_readers, close_sub_readers)
C new(sub_readers, sub_readers_sorter, close_sub_readers)
M reader_cache_helper() CacheHelper
from IndexReader
C close()
C dec_ref()
M equals(obj) boolean
M has_deletions?() boolean
M hash_code() int
C inc_ref()
M leaves() LeafReaderContext>
M num_deleted_docs() int
M ref_count() int
C register_parent_reader(reader)
M try_inc_ref() boolean
from CompositeReader
M context() CompositeReaderContext
M to_string() String
from BaseCompositeReader
M doc_freq(term) int
M get_doc_count(field) int
M get_sum_doc_freq(field) long
M get_sum_total_term_freq(field) long
M max_doc() int
M num_docs() int
M stored_fields() StoredFields
M term_vectors() TermVectors
M total_term_freq(term) long

org.apache.lucene.index.MultiReader

class extends BaseCompositeReader<IndexReader> 4 members

A CompositeReader which reads multiple indexes, appending their content. It can be used to create a view on several sub-readers (like DirectoryReader) and execute searches on it.

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.

Constructors

new

new ( IndexReader[] sub_readers )
Java: <init>(org.apache.lucene.index.IndexReader[] subReaders)

Construct a MultiReader aggregating the named set of (sub)readers.

Note that all subreaders are closed if this Multireader is closed.

nametypedescription
sub_readersorg.apache.lucene.index.IndexReader[]set of (sub)readers

new

new ( IndexReader[] sub_readers, boolean close_sub_readers )
Java: <init>(org.apache.lucene.index.IndexReader[] subReaders, boolean closeSubReaders)

Construct a MultiReader aggregating the named set of (sub)readers.

nametypedescription
sub_readersorg.apache.lucene.index.IndexReader[]set of (sub)readers; this array will be cloned.
close_sub_readersbooleanindicates whether the subreaders should be closed when this MultiReader is closed

new

new ( IndexReader[] sub_readers, Comparator<IndexReader> sub_readers_sorter, boolean close_sub_readers )
Java: <init>(org.apache.lucene.index.IndexReader[] subReaders, Comparator<org.apache.lucene.index.IndexReader> subReadersSorter, boolean closeSubReaders)

Construct a MultiReader aggregating the named set of (sub)readers.

nametypedescription
sub_readersorg.apache.lucene.index.IndexReader[]set of (sub)readers; this array will be cloned.
sub_readers_sorterComparator<org.apache.lucene.index.IndexReader>– a comparator, that if not null is used for sorting sub readers.
close_sub_readersbooleanindicates whether the subreaders should be closed when this MultiReader is closed

Instance Methods

reader_cache_helper

IndexReader.CacheHelper reader_cache_helper ( )
Java: getReaderCacheHelper() · also: get_reader_cache_helper

Inherited

from IndexReader

close

close ( )
Java: close()

Closes files associated with this index. Also saves any new deletions to disk. No other methods should be called after this has been called.

Throws

IOException if there is a low-level IO error

dec_ref

dec_ref ( )
Java: decRef()

Expert: decreases the refCount of this IndexReader instance. If the refCount drops to 0, then this reader is closed. If an exception is hit, the refCount is unchanged.

Throws

IOException in case an IOException occurs in doClose()

equals

boolean equals ( Object obj )
Java: equals(Object obj)

IndexReader subclasses are not allowed to implement equals/hashCode, so methods are declared final.

has_deletions?

boolean has_deletions? ( )
Java: hasDeletions() · also: has_deletions

Returns true if any documents have been deleted. Implementers should consider overriding this method if #maxDoc() or #numDocs() are not constant-time operations.

hash_code

int hash_code ( )
Java: hashCode()

IndexReader subclasses are not allowed to implement equals/hashCode, so methods are declared final.

inc_ref

inc_ref ( )
Java: incRef()

Expert: increments the refCount of this IndexReader instance. RefCounts are used to determine when a reader can be closed safely, i.e. as soon as there are no more references. Be sure to always call a corresponding #decRef, in a finally clause; otherwise the reader may never be closed. Note that #close simply calls decRef(), which means that the IndexReader will not really be closed until #decRef has been called for all outstanding references.

leaves

List<LeafReaderContext> leaves ( )
Java: leaves()

Returns the reader's leaves, or itself if this reader is atomic. This is a convenience method calling this.getContext().leaves().

num_deleted_docs

int num_deleted_docs ( )
Java: numDeletedDocs()

Returns the number of deleted documents.

NOTE: This operation may run in O(maxDoc).

ref_count

int ref_count ( )
Java: getRefCount() · also: get_ref_count

Expert: returns the current refCount for this reader

register_parent_reader

register_parent_reader ( IndexReader reader )
Java: registerParentReader(org.apache.lucene.index.IndexReader reader)

Expert: This method is called by IndexReaders which wrap other readers (e.g. CompositeReader or FilterLeafReader) to register the parent at the child (this reader) on construction of the parent. When this reader is closed, it will mark all registered parents as closed, too. The references to parent readers are weak only, so they can be GCed once they are no longer in use.

try_inc_ref

boolean try_inc_ref ( )
Java: tryIncRef()

Expert: increments the refCount of this IndexReader instance only if the IndexReader has not been closed yet and returns true iff the refCount was successfully incremented, otherwise false. If this method returns false the reader is either already closed or is currently being closed. Either way this reader instance shouldn't be used by an application unless true is returned.

RefCounts are used to determine when a reader can be closed safely, i.e. as soon as there are no more references. Be sure to always call a corresponding #decRef, in a finally clause; otherwise the reader may never be closed. Note that #close simply calls decRef(), which means that the IndexReader will not really be closed until #decRef has been called for all outstanding references.

from CompositeReader

context

CompositeReaderContext context ( )
Java: getContext() · also: get_context

to_string

String to_string ( )
Java: toString()

from BaseCompositeReader

doc_freq

int doc_freq ( Term term )
Java: docFreq(org.apache.lucene.index.Term term)

get_doc_count

int get_doc_count ( String field )
Java: getDocCount(String field)

get_sum_doc_freq

long get_sum_doc_freq ( String field )
Java: getSumDocFreq(String field)

get_sum_total_term_freq

long get_sum_total_term_freq ( String field )
Java: getSumTotalTermFreq(String field)

max_doc

int max_doc ( )
Java: maxDoc()

num_docs

int num_docs ( )
Java: numDocs()

stored_fields

StoredFields stored_fields ( )
Java: storedFields()

term_vectors

TermVectors term_vectors ( )
Java: termVectors()

total_term_freq

long total_term_freq ( Term term )
Java: totalTermFreq(org.apache.lucene.index.Term term)
this work for additional information regarding copyright ownership.