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, totalTermFreq
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, tryIncRef
public 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.IOException
public IndexReader.CacheHelper getReaderCacheHelper()
getReaderCacheHelper
in class IndexReader
public IndexReader.CacheHelper getCoreCacheHelper()
getCoreCacheHelper
in class LeafReader
public Terms terms(String field) throws IOException
terms
in class LeafReader
IOException
public NumericDocValues getNumericDocValues(String field) throws IOException
getNumericDocValues
in class LeafReader
IOException
public BinaryDocValues getBinaryDocValues(String field) throws IOException
getBinaryDocValues
in class LeafReader
IOException
public SortedNumericDocValues getSortedNumericDocValues(String field) throws IOException
getSortedNumericDocValues
in class LeafReader
IOException
public SortedDocValues getSortedDocValues(String field) throws IOException
getSortedDocValues
in class LeafReader
IOException
public SortedSetDocValues getSortedSetDocValues(String field) throws IOException
getSortedSetDocValues
in class LeafReader
IOException
public NumericDocValues getNormValues(String field) throws IOException
getNormValues
in class LeafReader
IOException
public Fields getTermVectors(int docID) throws IOException
getTermVectors
in class IndexReader
IOException
public int numDocs()
numDocs
in class IndexReader
public int maxDoc()
maxDoc
in class IndexReader
public void document(int docID, StoredFieldVisitor visitor) throws IOException
document
in class IndexReader
IOException
public Bits getLiveDocs()
getLiveDocs
in class LeafReader
public PointValues getPointValues(String field)
getPointValues
in class LeafReader
public FieldInfos getFieldInfos()
getFieldInfos
in class LeafReader
protected void doClose() throws IOException
doClose
in class IndexReader
IOException
public void checkIntegrity() throws IOException
checkIntegrity
in class LeafReader
IOException
public LeafMetaData getMetaData()
getMetaData
in class LeafReader
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.