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.LeafReaderThis class forces a composite reader (eg aMultiReaderorDirectoryReader) to emulate aLeafReader. This requires implementing the postings APIs on-the-fly, using the static methods inMultiFields,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 Summary
All 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.IndexReader.CacheHelpergetCoreCacheHelper()org.apache.lucene.index.FieldInfosgetFieldInfos()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()org.apache.lucene.index.Termsterms(String field)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.LeafReader
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreq
-
-
-
-
Method Detail
-
wrap
public 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
-
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
public org.apache.lucene.index.Terms terms(String field) throws IOException
- 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
public org.apache.lucene.index.BinaryDocValues getBinaryDocValues(String field) throws IOException
- 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
public org.apache.lucene.index.SortedDocValues getSortedDocValues(String field) throws IOException
- 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
public org.apache.lucene.index.NumericDocValues getNormValues(String field) throws IOException
- Specified by:
getNormValuesin classorg.apache.lucene.index.LeafReader- Throws:
IOException
-
getTermVectors
public org.apache.lucene.index.Fields getTermVectors(int docID) throws IOException- Specified by:
getTermVectorsin 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
-
getLiveDocs
public org.apache.lucene.util.Bits getLiveDocs()
- Specified by:
getLiveDocsin classorg.apache.lucene.index.LeafReader
-
getPointValues
public org.apache.lucene.index.PointValues getPointValues(String field)
- 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
protected void doClose() throws IOException- Specified by:
doClosein classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
checkIntegrity
public void checkIntegrity() throws IOException- 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
-
-