public final class SegmentReader extends CodecReader
Instances pointing to the same segment (but with different deletes, etc) may share the same core data.
LeafReader.CoreClosedListener
IndexReader.ReaderClosedListener
Constructor and Description |
---|
SegmentReader(SegmentCommitInfo si,
IOContext context)
Constructs a new SegmentReader with a new core.
|
Modifier and Type | Method and Description |
---|---|
void |
addCoreClosedListener(LeafReader.CoreClosedListener listener)
Expert: adds a CoreClosedListener to this reader's shared core
|
Directory |
directory()
Returns the directory this index resides in.
|
protected void |
doClose()
Implements close.
|
Object |
getCombinedCoreAndDeletesKey()
Expert: Returns a key for this IndexReader that also includes deletions,
so CachingWrapperFilter can find it again.
|
Object |
getCoreCacheKey()
Expert: Returns a key for this IndexReader, so CachingWrapperFilter can find
it again.
|
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 |
getLiveDocs()
Returns the
Bits representing live (not
deleted) docs. |
NormsProducer |
getNormsReader()
Expert: retrieve underlying NormsProducer
|
PointsReader |
getPointsReader()
Expert: retrieve underlying PointsReader
|
PointValues |
getPointValues()
Returns the
PointValues used for numeric or
spatial searches, or null if there are no point fields. |
FieldsProducer |
getPostingsReader()
Expert: retrieve underlying FieldsProducer
|
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.
|
void |
removeCoreClosedListener(LeafReader.CoreClosedListener listener)
Expert: removes a CoreClosedListener from this reader's shared core
|
String |
toString() |
checkIntegrity, document, fields, getBinaryDocValues, getChildResources, getDocsWithField, getNormValues, getNumericDocValues, getSortedDocValues, getSortedNumericDocValues, getSortedSetDocValues, getTermVectors, ramBytesUsed
addCoreClosedListenerAsReaderClosedListener, docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, removeCoreClosedListenerAsReaderClosedListener, terms, totalTermFreq
addReaderClosedListener, close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, removeReaderClosedListener, tryIncRef
public SegmentReader(SegmentCommitInfo si, IOContext context) throws IOException
CorruptIndexException
- if the index is corruptIOException
- if there is a low-level IO errorpublic Bits getLiveDocs()
LeafReader
Bits
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 LeafReader
protected void doClose() throws IOException
IndexReader
doClose
in class CodecReader
IOException
public FieldInfos getFieldInfos()
LeafReader
FieldInfos
describing all fields in
this reader.getFieldInfos
in class LeafReader
public int numDocs()
IndexReader
numDocs
in class IndexReader
public int maxDoc()
IndexReader
maxDoc
in class IndexReader
public TermVectorsReader getTermVectorsReader()
CodecReader
getTermVectorsReader
in class CodecReader
public StoredFieldsReader getFieldsReader()
CodecReader
getFieldsReader
in class CodecReader
public PointValues getPointValues()
LeafReader
PointValues
used for numeric or
spatial searches, or null if there are no point fields.getPointValues
in class LeafReader
public NormsProducer getNormsReader()
CodecReader
getNormsReader
in class CodecReader
public DocValuesProducer getDocValuesReader()
CodecReader
getDocValuesReader
in class CodecReader
public FieldsProducer getPostingsReader()
CodecReader
getPostingsReader
in class CodecReader
public PointsReader getPointsReader()
CodecReader
getPointsReader
in class CodecReader
public String getSegmentName()
public SegmentCommitInfo getSegmentInfo()
public Directory directory()
public Object getCoreCacheKey()
IndexReader
getCoreCacheKey
in class IndexReader
public Object getCombinedCoreAndDeletesKey()
IndexReader
getCombinedCoreAndDeletesKey
in class IndexReader
public void addCoreClosedListener(LeafReader.CoreClosedListener listener)
LeafReader
addCoreClosedListener
in class LeafReader
public void removeCoreClosedListener(LeafReader.CoreClosedListener listener)
LeafReader
removeCoreClosedListener
in class LeafReader
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.