Package org.apache.lucene.index
Class CodecReader
java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.LeafReader
org.apache.lucene.index.CodecReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
- Direct Known Subclasses:
FilterCodecReader,SegmentReader
LeafReader implemented by codec APIs.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener -
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckBounds(int docID) voidChecks consistency of this reader.protected voiddoClose()Implements close.final voiddocument(int docID, StoredFieldVisitor visitor) Expert: visits the fields of a stored document, for custom processing/loading of each field.final BinaryDocValuesgetBinaryDocValues(String field) ReturnsBinaryDocValuesfor this field, or null if no binary doc values were indexed for this field.Returns nested resources of this class.abstract DocValuesProducerExpert: retrieve underlying DocValuesProducerprivate FieldInfogetDVField(String field, DocValuesType type) abstract StoredFieldsReaderExpert: retrieve thread-private StoredFieldsReaderabstract NormsProducerExpert: retrieve underlying NormsProducerfinal NumericDocValuesgetNormValues(String field) ReturnsNumericDocValuesrepresenting norms for this field, or null if noNumericDocValueswere indexed.final NumericDocValuesgetNumericDocValues(String field) ReturnsNumericDocValuesfor this field, or null if no numeric doc values were indexed for this field.abstract PointsReaderExpert: retrieve underlying PointsReaderfinal PointValuesgetPointValues(String field) Returns thePointValuesused for numeric or spatial searches for the given field, or null if there are no point fields.abstract FieldsProducerExpert: retrieve underlying FieldsProducerfinal SortedDocValuesgetSortedDocValues(String field) ReturnsSortedDocValuesfor this field, or null if noSortedDocValueswere indexed for this field.final SortedNumericDocValuesgetSortedNumericDocValues(String field) ReturnsSortedNumericDocValuesfor this field, or null if noSortedNumericDocValueswere indexed for this field.final SortedSetDocValuesgetSortedSetDocValues(String field) ReturnsSortedSetDocValuesfor this field, or null if noSortedSetDocValueswere indexed for this field.final FieldsgetTermVectors(int docID) Retrieve term vectors for this document, or null if term vectors were not indexed.abstract TermVectorsReaderExpert: retrieve thread-private TermVectorsReaderlongReturn the memory usage of this object in bytes.final TermsReturns theTermsindex for this field, or null if it has none.Methods inherited from class org.apache.lucene.index.LeafReader
docFreq, getContext, getCoreCacheHelper, getDocCount, getFieldInfos, getLiveDocs, getMetaData, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreqMethods inherited from class org.apache.lucene.index.IndexReader
close, decRef, document, document, ensureOpen, equals, getReaderCacheHelper, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, maxDoc, notifyReaderClosedListeners, numDeletedDocs, numDocs, registerParentReader, tryIncRef
-
Constructor Details
-
CodecReader
protected CodecReader()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
getFieldsReader
Expert: retrieve thread-private StoredFieldsReader -
getTermVectorsReader
Expert: retrieve thread-private TermVectorsReader -
getNormsReader
Expert: retrieve underlying NormsProducer -
getDocValuesReader
Expert: retrieve underlying DocValuesProducer -
getPostingsReader
Expert: retrieve underlying FieldsProducer -
getPointsReader
Expert: retrieve underlying PointsReader -
document
Description 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:
IOException
-
getTermVectors
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:
IOException
-
checkBounds
private void checkBounds(int docID) -
terms
Description copied from class:LeafReaderReturns theTermsindex for this field, or null if it has none.- Specified by:
termsin classLeafReader- Throws:
IOException
-
getDVField
-
getNumericDocValues
Description copied from class:LeafReaderReturnsNumericDocValuesfor this field, or null if no numeric doc values were indexed for this field. The returned instance should only be used by a single thread.- Specified by:
getNumericDocValuesin classLeafReader- Throws:
IOException
-
getBinaryDocValues
Description copied from class:LeafReaderReturnsBinaryDocValuesfor this field, or null if no binary doc values were indexed for this field. The returned instance should only be used by a single thread.- Specified by:
getBinaryDocValuesin classLeafReader- Throws:
IOException
-
getSortedDocValues
Description copied from class:LeafReaderReturnsSortedDocValuesfor this field, or null if noSortedDocValueswere indexed for this field. The returned instance should only be used by a single thread.- Specified by:
getSortedDocValuesin classLeafReader- Throws:
IOException
-
getSortedNumericDocValues
Description copied from class:LeafReaderReturnsSortedNumericDocValuesfor this field, or null if noSortedNumericDocValueswere indexed for this field. The returned instance should only be used by a single thread.- Specified by:
getSortedNumericDocValuesin classLeafReader- Throws:
IOException
-
getSortedSetDocValues
Description copied from class:LeafReaderReturnsSortedSetDocValuesfor this field, or null if noSortedSetDocValueswere indexed for this field. The returned instance should only be used by a single thread.- Specified by:
getSortedSetDocValuesin classLeafReader- Throws:
IOException
-
getNormValues
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:
IOException
-
getPointValues
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:
IOException
-
doClose
Description copied from class:IndexReaderImplements close.- Specified by:
doClosein classIndexReader- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
getChildResources
Description copied from interface:AccountableReturns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).- Specified by:
getChildResourcesin interfaceAccountable- See Also:
-
checkIntegrity
Description 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:
IOException
-