Package org.apache.solr.index
Class SlowCompositeReaderWrapper
java.lang.Object
org.apache.lucene.index.IndexReader
org.apache.lucene.index.LeafReader
org.apache.solr.index.SlowCompositeReaderWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class SlowCompositeReaderWrapper
extends org.apache.lucene.index.LeafReader
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()org.apache.lucene.index.BinaryDocValuesgetBinaryDocValues(String field) org.apache.lucene.index.ByteVectorValuesgetByteVectorValues(String field) org.apache.lucene.index.IndexReader.CacheHelperorg.apache.lucene.index.DocValuesSkippergetDocValuesSkipper(String field) org.apache.lucene.index.FieldInfosorg.apache.lucene.index.FloatVectorValuesgetFloatVectorValues(String field) org.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) intmaxDoc()intnumDocs()voidsearchNearestVectors(String field, byte[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) voidsearchNearestVectors(String field, float[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) 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, ensureOpen, equals, getRefCount, 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
-
getDocValuesSkipper
public org.apache.lucene.index.DocValuesSkipper getDocValuesSkipper(String field) throws IOException - Specified by:
getDocValuesSkipperin classorg.apache.lucene.index.LeafReader- 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
-
termVectors
- Specified by:
termVectorsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
storedFields
- Specified by:
storedFieldsin 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
-
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
-
getFloatVectorValues
- Specified by:
getFloatVectorValuesin classorg.apache.lucene.index.LeafReader
-
getByteVectorValues
- Specified by:
getByteVectorValuesin classorg.apache.lucene.index.LeafReader
-
searchNearestVectors
public void searchNearestVectors(String field, float[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) throws IOException - Specified by:
searchNearestVectorsin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
searchNearestVectors
public void searchNearestVectors(String field, byte[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) throws IOException - Specified by:
searchNearestVectorsin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
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
-