Package org.apache.tika.eval.app.tools
Class SlowCompositeReaderWrapper
java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.LeafReader
org.apache.tika.eval.app.tools.SlowCompositeReaderWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class SlowCompositeReaderWrapper
extends org.apache.lucene.index.LeafReader
COPIED VERBATIM FROM LUCENE
This class forces a composite reader (eg a
MultiReader or DirectoryReader) to emulate a
LeafReader. This requires implementing the postings
APIs on-the-fly, using the static methods in MultiTerms, 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
org.apache.lucene.index.IndexReader.CacheHelper, org.apache.lucene.index.IndexReader.CacheKey, org.apache.lucene.index.IndexReader.ClosedListener -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voiddoClose()voiddocument(int docID, org.apache.lucene.index.StoredFieldVisitor visitor) org.apache.lucene.index.BinaryDocValuesgetBinaryDocValues(String field) org.apache.lucene.index.ByteVectorValuesorg.apache.lucene.index.IndexReader.CacheHelperorg.apache.lucene.index.FieldInfosorg.apache.lucene.index.FloatVectorValuesorg.apache.lucene.util.Bitsorg.apache.lucene.index.LeafMetaDataorg.apache.lucene.index.NumericDocValuesgetNormValues(String field) org.apache.lucene.index.NumericDocValuesgetNumericDocValues(String field) org.apache.lucene.index.PointValuesgetPointValues(String field) org.apache.lucene.index.IndexReader.CacheHelperorg.apache.lucene.index.SortedDocValuesgetSortedDocValues(String field) org.apache.lucene.index.SortedNumericDocValuesgetSortedNumericDocValues(String field) org.apache.lucene.index.SortedSetDocValuesgetSortedSetDocValues(String field) org.apache.lucene.index.FieldsgetTermVectors(int docID) intmaxDoc()intnumDocs()voidsearchNearestVectors(String string, byte[] bytes, org.apache.lucene.search.KnnCollector kc, org.apache.lucene.util.Bits bits) voidsearchNearestVectors(String string, float[] floats, org.apache.lucene.search.KnnCollector kc, org.apache.lucene.util.Bits bits) org.apache.lucene.index.StoredFieldsorg.apache.lucene.index.Termsorg.apache.lucene.index.TermVectorstoString()static org.apache.lucene.index.LeafReaderwrap(org.apache.lucene.index.IndexReader reader) This method is sugar for getting anLeafReaderfrom anIndexReaderof any kind.Methods inherited from class org.apache.lucene.index.LeafReader
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, searchNearestVectors, searchNearestVectors, totalTermFreqMethods inherited from class org.apache.lucene.index.IndexReader
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, notifyReaderClosedListeners, numDeletedDocs, registerParentReader, tryIncRef
-
Method Details
-
wrap
public static org.apache.lucene.index.LeafReader wrap(org.apache.lucene.index.IndexReader reader) throws IOException This method is sugar for getting anLeafReaderfrom anIndexReaderof any kind. If the reader is already atomic, it is returned unchanged, otherwise wrapped by this class.- Throws:
IOException
-
toString
-
getReaderCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getReaderCacheHelper()- Specified by:
getReaderCacheHelperin classorg.apache.lucene.index.IndexReader
-
getCoreCacheHelper
public org.apache.lucene.index.IndexReader.CacheHelper getCoreCacheHelper()- Specified by:
getCoreCacheHelperin classorg.apache.lucene.index.LeafReader
-
terms
- Specified by:
termsin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getNumericDocValues
public org.apache.lucene.index.NumericDocValues getNumericDocValues(String field) throws IOException - Specified by:
getNumericDocValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getBinaryDocValues
- Specified by:
getBinaryDocValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getSortedNumericDocValues
public org.apache.lucene.index.SortedNumericDocValues getSortedNumericDocValues(String field) throws IOException - Specified by:
getSortedNumericDocValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getSortedDocValues
- Specified by:
getSortedDocValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getSortedSetDocValues
public org.apache.lucene.index.SortedSetDocValues getSortedSetDocValues(String field) throws IOException - Specified by:
getSortedSetDocValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getNormValues
- Specified by:
getNormValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getFloatVectorValues
- Specified by:
getFloatVectorValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getByteVectorValues
- Specified by:
getByteVectorValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
searchNearestVectors
public void searchNearestVectors(String string, float[] floats, org.apache.lucene.search.KnnCollector kc, org.apache.lucene.util.Bits bits) throws IOException - Specified by:
searchNearestVectorsin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
searchNearestVectors
public void searchNearestVectors(String string, byte[] bytes, org.apache.lucene.search.KnnCollector kc, org.apache.lucene.util.Bits bits) throws IOException - Specified by:
searchNearestVectorsin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getTermVectors
- Specified by:
getTermVectorsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
termVectors
- Specified by:
termVectorsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
numDocs
public int numDocs()- Specified by:
numDocsin classorg.apache.lucene.index.IndexReader
-
maxDoc
public int maxDoc()- Specified by:
maxDocin classorg.apache.lucene.index.IndexReader
-
document
public void document(int docID, org.apache.lucene.index.StoredFieldVisitor visitor) throws IOException - Specified by:
documentin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
storedFields
- Specified by:
storedFieldsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
getLiveDocs
public org.apache.lucene.util.Bits getLiveDocs()- Specified by:
getLiveDocsin classorg.apache.lucene.index.LeafReader
-
getPointValues
- Specified by:
getPointValuesin classorg.apache.lucene.index.LeafReader
-
getFieldInfos
public org.apache.lucene.index.FieldInfos getFieldInfos()- Specified by:
getFieldInfosin classorg.apache.lucene.index.LeafReader
-
doClose
- Specified by:
doClosein classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
checkIntegrity
- Specified by:
checkIntegrityin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getMetaData
public org.apache.lucene.index.LeafMetaData getMetaData()- Specified by:
getMetaDatain classorg.apache.lucene.index.LeafReader
-