public class UninvertingReader extends FilterLeafReader
This is accomplished by "inverting the inverted index" or "uninversion".
The uninversion process happens lazily: upon the first request for the
field's docvalues (e.g. via LeafReader.getNumericDocValues(String)
or similar), it will create the docvalues on-the-fly if needed and cache it,
based on the core cache key of the wrapped LeafReader.
Modifier and Type | Class and Description |
---|---|
static class |
UninvertingReader.FieldCacheStats
Return information about the backing cache
|
static class |
UninvertingReader.Type
Specifies the type of uninversion to apply for the field.
|
FilterLeafReader.FilterFields, FilterLeafReader.FilterPostingsEnum, FilterLeafReader.FilterTerms, FilterLeafReader.FilterTermsEnum
LeafReader.CoreClosedListener
IndexReader.ReaderClosedListener
in
Constructor and Description |
---|
UninvertingReader(LeafReader in,
Map<String,UninvertingReader.Type> mapping)
Create a new UninvertingReader with the specified mapping
|
Modifier and Type | Method and Description |
---|---|
BinaryDocValues |
getBinaryDocValues(String field) |
Object |
getCombinedCoreAndDeletesKey() |
Object |
getCoreCacheKey() |
Bits |
getDocsWithField(String field) |
FieldInfos |
getFieldInfos() |
NumericDocValues |
getNumericDocValues(String field) |
SortedDocValues |
getSortedDocValues(String field) |
SortedSetDocValues |
getSortedSetDocValues(String field) |
static UninvertingReader.FieldCacheStats |
getUninvertedStats()
Return information about the backing cache
|
static int |
getUninvertedStatsSize() |
String |
toString() |
static DirectoryReader |
wrap(DirectoryReader in,
Function<LeafReader,Map<String,UninvertingReader.Type>> perSegmentMapper)
Wraps a provided DirectoryReader.
|
static DirectoryReader |
wrap(DirectoryReader in,
Map<String,UninvertingReader.Type> mapping) |
addCoreClosedListener, checkIntegrity, doClose, document, fields, getDelegate, getIndexSort, getLiveDocs, getNormValues, getPointValues, getSortedNumericDocValues, getTermVectors, maxDoc, numDocs, removeCoreClosedListener, unwrap
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 UninvertingReader(LeafReader in, Map<String,UninvertingReader.Type> mapping)
Expert: This should almost never be used. Use wrap(DirectoryReader, Function)
instead.
public static DirectoryReader wrap(DirectoryReader in, Function<LeafReader,Map<String,UninvertingReader.Type>> perSegmentMapper) throws IOException
DirectoryReader.openIfChanged(DirectoryReader)
)
and so on.in
- input directory readerperSegmentMapper
- function to map a segment reader to a mapping of fields to their uninversion typeIOException
public static DirectoryReader wrap(DirectoryReader in, Map<String,UninvertingReader.Type> mapping) throws IOException
IOException
public FieldInfos getFieldInfos()
getFieldInfos
in class FilterLeafReader
public NumericDocValues getNumericDocValues(String field) throws IOException
getNumericDocValues
in class FilterLeafReader
IOException
public BinaryDocValues getBinaryDocValues(String field) throws IOException
getBinaryDocValues
in class FilterLeafReader
IOException
public SortedDocValues getSortedDocValues(String field) throws IOException
getSortedDocValues
in class FilterLeafReader
IOException
public SortedSetDocValues getSortedSetDocValues(String field) throws IOException
getSortedSetDocValues
in class FilterLeafReader
IOException
public Bits getDocsWithField(String field) throws IOException
getDocsWithField
in class FilterLeafReader
IOException
public Object getCoreCacheKey()
getCoreCacheKey
in class IndexReader
public Object getCombinedCoreAndDeletesKey()
getCombinedCoreAndDeletesKey
in class IndexReader
public String toString()
toString
in class FilterLeafReader
public static UninvertingReader.FieldCacheStats getUninvertedStats()
public static int getUninvertedStatsSize()
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.