public final class SegmentReader extends CodecReader
Instances pointing to the same segment (but with different deletes, etc) may share the same core data.
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener| Modifier and Type | Method and Description |
|---|---|
Directory |
directory()
Returns the directory this index resides in.
|
protected void |
doClose()
Implements close.
|
IndexReader.CacheHelper |
getCoreCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this leaf regardless of deletions. |
DocValuesProducer |
getDocValuesReader()
Expert: retrieve underlying DocValuesProducer
|
FieldInfos |
getFieldInfos()
Get the
FieldInfos describing all fields in
this reader. |
StoredFieldsReader |
getFieldsReader()
Expert: retrieve thread-private StoredFieldsReader
|
Bits |
getHardLiveDocs()
Returns the live docs that are not hard-deleted.
|
Bits |
getLiveDocs()
Returns the
Bits representing live (not
deleted) docs. |
LeafMetaData |
getMetaData()
Return metadata about this leaf.
|
NormsProducer |
getNormsReader()
Expert: retrieve underlying NormsProducer
|
PointsReader |
getPointsReader()
Expert: retrieve underlying PointsReader
|
FieldsProducer |
getPostingsReader()
Expert: retrieve underlying FieldsProducer
|
IndexReader.CacheHelper |
getReaderCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this reader. |
SegmentCommitInfo |
getSegmentInfo()
Return the SegmentInfoPerCommit of the segment this reader is reading.
|
String |
getSegmentName()
Return the name of the segment this reader is reading.
|
TermVectorsReader |
getTermVectorsReader()
Expert: retrieve thread-private TermVectorsReader
|
int |
maxDoc()
Returns one greater than the largest possible document number.
|
int |
numDocs()
Returns the number of documents in this index.
|
String |
toString() |
checkIntegrity, document, getBinaryDocValues, getChildResources, getNormValues, getNumericDocValues, getPointValues, getSortedDocValues, getSortedNumericDocValues, getSortedSetDocValues, getTermVectors, ramBytesUsed, termsdocFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreqclose, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, tryIncRefpublic Bits getLiveDocs()
LeafReaderBits 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.getLiveDocs in class LeafReaderprotected void doClose()
throws IOException
IndexReaderdoClose in class CodecReaderIOExceptionpublic FieldInfos getFieldInfos()
LeafReaderFieldInfos describing all fields in
this reader.
Note: Implementations should cache the FieldInfos
instance returned by this method such that subsequent
calls to this method return the same instance.getFieldInfos in class LeafReaderpublic int numDocs()
IndexReaderNOTE: This operation may run in O(maxDoc). Implementations that can't return this number in constant-time should cache it.
numDocs in class IndexReaderpublic int maxDoc()
IndexReadermaxDoc in class IndexReaderpublic TermVectorsReader getTermVectorsReader()
CodecReadergetTermVectorsReader in class CodecReaderpublic StoredFieldsReader getFieldsReader()
CodecReadergetFieldsReader in class CodecReaderpublic PointsReader getPointsReader()
CodecReadergetPointsReader in class CodecReaderpublic NormsProducer getNormsReader()
CodecReadergetNormsReader in class CodecReaderpublic DocValuesProducer getDocValuesReader()
CodecReadergetDocValuesReader in class CodecReaderpublic FieldsProducer getPostingsReader()
CodecReadergetPostingsReader in class CodecReaderpublic String getSegmentName()
public SegmentCommitInfo getSegmentInfo()
public Directory directory()
public IndexReader.CacheHelper getReaderCacheHelper()
IndexReaderIndexReader.CacheHelper that 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 null indicates 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.
getReaderCacheHelper in class IndexReaderpublic IndexReader.CacheHelper getCoreCacheHelper()
LeafReaderIndexReader.CacheHelper that 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 using
IndexReader.getReaderCacheHelper() if you need deletions or dv updates to be
taken into account.
A return value of null indicates 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.
getCoreCacheHelper in class LeafReaderpublic LeafMetaData getMetaData()
LeafReadergetMetaData in class LeafReaderpublic Bits getHardLiveDocs()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.