public final class SlowCompositeReaderWrapper extends LeafReader
MultiReader or DirectoryReader) to emulate a
LeafReader. This requires implementing the postings
APIs on-the-fly, using the static methods in MultiFields, MultiDocValues, by stepping through
the sub-readers to merge fields/terms, appending docs, etc.
NOTE: this class almost always results in a
performance hit. If this is important to your use case,
you'll get better performance by gathering the sub readers using
IndexReader.getContext() to get the
leaves and then operate per-LeafReader,
instead of using this class.
IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener| Modifier and Type | Method and Description |
|---|---|
void |
checkIntegrity() |
protected void |
doClose() |
void |
document(int docID,
StoredFieldVisitor visitor) |
BinaryDocValues |
getBinaryDocValues(String field) |
IndexReader.CacheHelper |
getCoreCacheHelper() |
FieldInfos |
getFieldInfos() |
Bits |
getLiveDocs() |
LeafMetaData |
getMetaData() |
NumericDocValues |
getNormValues(String field) |
NumericDocValues |
getNumericDocValues(String field) |
PointValues |
getPointValues(String field) |
IndexReader.CacheHelper |
getReaderCacheHelper() |
SortedDocValues |
getSortedDocValues(String field) |
SortedNumericDocValues |
getSortedNumericDocValues(String field) |
SortedSetDocValues |
getSortedSetDocValues(String field) |
Fields |
getTermVectors(int docID) |
int |
maxDoc() |
int |
numDocs() |
Terms |
terms(String field) |
String |
toString() |
static LeafReader |
wrap(IndexReader reader)
This method is sugar for getting an
LeafReader from
an IndexReader of any kind. |
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreqclose, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, tryIncRefpublic static LeafReader wrap(IndexReader reader) throws IOException
LeafReader from
an IndexReader of any kind. If the reader is already atomic,
it is returned unchanged, otherwise wrapped by this class.IOExceptionpublic IndexReader.CacheHelper getReaderCacheHelper()
getReaderCacheHelper in class IndexReaderpublic IndexReader.CacheHelper getCoreCacheHelper()
getCoreCacheHelper in class LeafReaderpublic Terms terms(String field) throws IOException
terms in class LeafReaderIOExceptionpublic NumericDocValues getNumericDocValues(String field) throws IOException
getNumericDocValues in class LeafReaderIOExceptionpublic BinaryDocValues getBinaryDocValues(String field) throws IOException
getBinaryDocValues in class LeafReaderIOExceptionpublic SortedNumericDocValues getSortedNumericDocValues(String field) throws IOException
getSortedNumericDocValues in class LeafReaderIOExceptionpublic SortedDocValues getSortedDocValues(String field) throws IOException
getSortedDocValues in class LeafReaderIOExceptionpublic SortedSetDocValues getSortedSetDocValues(String field) throws IOException
getSortedSetDocValues in class LeafReaderIOExceptionpublic NumericDocValues getNormValues(String field) throws IOException
getNormValues in class LeafReaderIOExceptionpublic Fields getTermVectors(int docID) throws IOException
getTermVectors in class IndexReaderIOExceptionpublic int numDocs()
numDocs in class IndexReaderpublic int maxDoc()
maxDoc in class IndexReaderpublic void document(int docID,
StoredFieldVisitor visitor)
throws IOException
document in class IndexReaderIOExceptionpublic Bits getLiveDocs()
getLiveDocs in class LeafReaderpublic PointValues getPointValues(String field)
getPointValues in class LeafReaderpublic FieldInfos getFieldInfos()
getFieldInfos in class LeafReaderprotected void doClose()
throws IOException
doClose in class IndexReaderIOExceptionpublic void checkIntegrity()
throws IOException
checkIntegrity in class LeafReaderIOExceptionpublic LeafMetaData getMetaData()
getMetaData in class LeafReaderCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.