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.LeafReaderCOPIED VERBATIM FROM LUCENE This class forces a composite reader (eg aMultiReaderorDirectoryReader) to emulate aLeafReader. This requires implementing the postings APIs on-the-fly, using the static methods inMultiTerms,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.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()protected voiddoClose()voiddocument(int docID, org.apache.lucene.index.StoredFieldVisitor visitor)org.apache.lucene.index.BinaryDocValuesgetBinaryDocValues(String field)org.apache.lucene.index.ByteVectorValuesgetByteVectorValues(String s)org.apache.lucene.index.IndexReader.CacheHelpergetCoreCacheHelper()org.apache.lucene.index.FieldInfosgetFieldInfos()org.apache.lucene.index.FloatVectorValuesgetFloatVectorValues(String s)org.apache.lucene.util.BitsgetLiveDocs()org.apache.lucene.index.LeafMetaDatagetMetaData()org.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.CacheHelpergetReaderCacheHelper()org.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.StoredFieldsstoredFields()org.apache.lucene.index.Termsterms(String field)org.apache.lucene.index.TermVectorstermVectors()StringtoString()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.LeafReaderdocFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, searchNearestVectors, searchNearestVectors, totalTermFreq
 
- 
 
- 
- 
- 
Method Detail- 
wrappublic static org.apache.lucene.index.LeafReader wrap(org.apache.lucene.index.IndexReader reader) throws IOExceptionThis 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
 
 - 
getReaderCacheHelperpublic org.apache.lucene.index.IndexReader.CacheHelper getReaderCacheHelper() - Specified by:
- getReaderCacheHelperin class- org.apache.lucene.index.IndexReader
 
 - 
getCoreCacheHelperpublic org.apache.lucene.index.IndexReader.CacheHelper getCoreCacheHelper() - Specified by:
- getCoreCacheHelperin class- org.apache.lucene.index.LeafReader
 
 - 
termspublic org.apache.lucene.index.Terms terms(String field) throws IOException - Specified by:
- termsin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getNumericDocValuespublic org.apache.lucene.index.NumericDocValues getNumericDocValues(String field) throws IOException - Specified by:
- getNumericDocValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getBinaryDocValuespublic org.apache.lucene.index.BinaryDocValues getBinaryDocValues(String field) throws IOException - Specified by:
- getBinaryDocValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getSortedNumericDocValuespublic org.apache.lucene.index.SortedNumericDocValues getSortedNumericDocValues(String field) throws IOException - Specified by:
- getSortedNumericDocValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getSortedDocValuespublic org.apache.lucene.index.SortedDocValues getSortedDocValues(String field) throws IOException - Specified by:
- getSortedDocValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getSortedSetDocValuespublic org.apache.lucene.index.SortedSetDocValues getSortedSetDocValues(String field) throws IOException - Specified by:
- getSortedSetDocValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getNormValuespublic org.apache.lucene.index.NumericDocValues getNormValues(String field) throws IOException - Specified by:
- getNormValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getFloatVectorValuespublic org.apache.lucene.index.FloatVectorValues getFloatVectorValues(String s) throws IOException - Specified by:
- getFloatVectorValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getByteVectorValuespublic org.apache.lucene.index.ByteVectorValues getByteVectorValues(String s) throws IOException - Specified by:
- getByteVectorValuesin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
searchNearestVectorspublic void searchNearestVectors(String string, float[] floats, org.apache.lucene.search.KnnCollector kc, org.apache.lucene.util.Bits bits) throws IOException - Specified by:
- searchNearestVectorsin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
searchNearestVectorspublic void searchNearestVectors(String string, byte[] bytes, org.apache.lucene.search.KnnCollector kc, org.apache.lucene.util.Bits bits) throws IOException - Specified by:
- searchNearestVectorsin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getTermVectorspublic org.apache.lucene.index.Fields getTermVectors(int docID) throws IOException- Specified by:
- getTermVectorsin class- org.apache.lucene.index.IndexReader
- Throws:
- IOException
 
 - 
termVectorspublic org.apache.lucene.index.TermVectors termVectors() throws IOException- Specified by:
- termVectorsin class- org.apache.lucene.index.IndexReader
- Throws:
- IOException
 
 - 
numDocspublic int numDocs() - Specified by:
- numDocsin class- org.apache.lucene.index.IndexReader
 
 - 
maxDocpublic int maxDoc() - Specified by:
- maxDocin class- org.apache.lucene.index.IndexReader
 
 - 
documentpublic void document(int docID, org.apache.lucene.index.StoredFieldVisitor visitor) throws IOException- Specified by:
- documentin class- org.apache.lucene.index.IndexReader
- Throws:
- IOException
 
 - 
storedFieldspublic org.apache.lucene.index.StoredFields storedFields() throws IOException- Specified by:
- storedFieldsin class- org.apache.lucene.index.IndexReader
- Throws:
- IOException
 
 - 
getLiveDocspublic org.apache.lucene.util.Bits getLiveDocs() - Specified by:
- getLiveDocsin class- org.apache.lucene.index.LeafReader
 
 - 
getPointValuespublic org.apache.lucene.index.PointValues getPointValues(String field) - Specified by:
- getPointValuesin class- org.apache.lucene.index.LeafReader
 
 - 
getFieldInfospublic org.apache.lucene.index.FieldInfos getFieldInfos() - Specified by:
- getFieldInfosin class- org.apache.lucene.index.LeafReader
 
 - 
doCloseprotected void doClose() throws IOException- Specified by:
- doClosein class- org.apache.lucene.index.IndexReader
- Throws:
- IOException
 
 - 
checkIntegritypublic void checkIntegrity() throws IOException- Specified by:
- checkIntegrityin class- org.apache.lucene.index.LeafReader
- Throws:
- IOException
 
 - 
getMetaDatapublic org.apache.lucene.index.LeafMetaData getMetaData() - Specified by:
- getMetaDatain class- org.apache.lucene.index.LeafReader
 
 
- 
 
-