Package org.apache.lucene.index
Class DocValuesLeafReader
- java.lang.Object
-
- org.apache.lucene.index.IndexReader
-
- org.apache.lucene.index.LeafReader
-
- org.apache.lucene.index.DocValuesLeafReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
abstract class DocValuesLeafReader extends LeafReader
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener
-
-
Constructor Summary
Constructors Constructor Description DocValuesLeafReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()Checks consistency of this reader.protected voiddoClose()Implements close.voiddocument(int docID, StoredFieldVisitor visitor)Expert: visits the fields of a stored document, for custom processing/loading of each field.IndexReader.CacheHelpergetCoreCacheHelper()Optional method: Return aIndexReader.CacheHelperthat can be used to cache based on the content of this leaf regardless of deletions.BitsgetLiveDocs()Returns theBitsrepresenting live (not deleted) docs.LeafMetaDatagetMetaData()Return metadata about this leaf.NumericDocValuesgetNormValues(java.lang.String field)ReturnsNumericDocValuesrepresenting norms for this field, or null if noNumericDocValueswere indexed.PointValuesgetPointValues(java.lang.String field)Returns thePointValuesused for numeric or spatial searches for the given field, or null if there are no point fields.IndexReader.CacheHelpergetReaderCacheHelper()Optional method: Return aIndexReader.CacheHelperthat can be used to cache based on the content of this reader.FieldsgetTermVectors(int docID)Retrieve term vectors for this document, or null if term vectors were not indexed.intmaxDoc()Returns one greater than the largest possible document number.intnumDocs()Returns the number of documents in this index.Termsterms(java.lang.String field)Returns theTermsindex for this field, or null if it has none.-
Methods inherited from class org.apache.lucene.index.LeafReader
docFreq, getBinaryDocValues, getContext, getDocCount, getFieldInfos, getNumericDocValues, getSortedDocValues, getSortedNumericDocValues, getSortedSetDocValues, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreq
-
Methods inherited from class org.apache.lucene.index.IndexReader
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, notifyReaderClosedListeners, numDeletedDocs, registerParentReader, tryIncRef
-
-
-
-
Method Detail
-
getCoreCacheHelper
public final IndexReader.CacheHelper getCoreCacheHelper()
Description copied from class:LeafReaderOptional method: Return aIndexReader.CacheHelperthat can be used to cache based on the content of this leaf regardless of deletions. Two readers that have the same data but different sets of deleted documents or doc values updates may be considered equal. Consider usingIndexReader.getReaderCacheHelper()if you need deletions or dv updates to be taken into account.A return value of
nullindicates that this reader is not suited for caching, which is typically the case for short-lived wrappers that alter the content of the wrapped leaf reader.- Specified by:
getCoreCacheHelperin classLeafReader
-
terms
public final Terms terms(java.lang.String field) throws java.io.IOException
Description copied from class:LeafReaderReturns theTermsindex for this field, or null if it has none.- Specified by:
termsin classLeafReader- Throws:
java.io.IOException
-
getNormValues
public final NumericDocValues getNormValues(java.lang.String field) throws java.io.IOException
Description copied from class:LeafReaderReturnsNumericDocValuesrepresenting norms for this field, or null if noNumericDocValueswere indexed. The returned instance should only be used by a single thread.- Specified by:
getNormValuesin classLeafReader- Throws:
java.io.IOException
-
getLiveDocs
public final Bits getLiveDocs()
Description copied from class:LeafReaderReturns theBitsrepresenting 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.- Specified by:
getLiveDocsin classLeafReader
-
getPointValues
public final PointValues getPointValues(java.lang.String field) throws java.io.IOException
Description copied from class:LeafReaderReturns thePointValuesused for numeric or spatial searches for the given field, or null if there are no point fields.- Specified by:
getPointValuesin classLeafReader- Throws:
java.io.IOException
-
checkIntegrity
public final void checkIntegrity() throws java.io.IOExceptionDescription copied from class:LeafReaderChecks 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.
- Specified by:
checkIntegrityin classLeafReader- Throws:
java.io.IOException
-
getMetaData
public final LeafMetaData getMetaData()
Description copied from class:LeafReaderReturn metadata about this leaf.- Specified by:
getMetaDatain classLeafReader
-
getTermVectors
public final Fields getTermVectors(int docID) throws java.io.IOException
Description copied from class:IndexReaderRetrieve 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).- Specified by:
getTermVectorsin classIndexReader- Throws:
java.io.IOException
-
numDocs
public final int numDocs()
Description copied from class:IndexReaderReturns the number of documents in this index.NOTE: This operation may run in O(maxDoc). Implementations that can't return this number in constant-time should cache it.
- Specified by:
numDocsin classIndexReader
-
maxDoc
public final int maxDoc()
Description copied from class:IndexReaderReturns 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.- Specified by:
maxDocin classIndexReader
-
document
public final void document(int docID, StoredFieldVisitor visitor) throws java.io.IOExceptionDescription copied from class:IndexReaderExpert: visits the fields of a stored document, for custom processing/loading of each field. If you simply want to load all fields, useIndexReader.document(int). If you want to load a subset, useDocumentStoredFieldVisitor.- Specified by:
documentin classIndexReader- Throws:
java.io.IOException
-
doClose
protected final void doClose() throws java.io.IOExceptionDescription copied from class:IndexReaderImplements close.- Specified by:
doClosein classIndexReader- Throws:
java.io.IOException
-
getReaderCacheHelper
public final IndexReader.CacheHelper getReaderCacheHelper()
Description copied from class:IndexReaderOptional method: Return aIndexReader.CacheHelperthat can be used to cache based on the content of this reader. Two readers that have different data or different sets of deleted documents will be considered different.A return value of
nullindicates that this reader is not suited for caching, which is typically the case for short-lived wrappers that alter the content of the wrapped reader.- Specified by:
getReaderCacheHelperin classIndexReader
-
-