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.
LeafReader.CoreClosedListener
IndexReader.ReaderClosedListener
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 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 void addCoreClosedListener(LeafReader.CoreClosedListener listener)
addCoreClosedListener
in class LeafReader
public void removeCoreClosedListener(LeafReader.CoreClosedListener listener)
removeCoreClosedListener
in class LeafReader
public Fields fields()
fields
in class LeafReader
public NumericDocValues getNumericDocValues(String field) throws IOException
getNumericDocValues
in class LeafReader
IOException
public Bits getDocsWithField(String field) throws IOException
getDocsWithField
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()
getPointValues
in class LeafReader
public FieldInfos getFieldInfos()
getFieldInfos
in class LeafReader
public Object getCoreCacheKey()
getCoreCacheKey
in class IndexReader
public Object getCombinedCoreAndDeletesKey()
getCombinedCoreAndDeletesKey
in class IndexReader
protected void doClose() throws IOException
doClose
in class IndexReader
IOException
public void checkIntegrity() throws IOException
checkIntegrity
in class LeafReader
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.