public final class SortingCodecReader extends FilterCodecReader
CodecReader
which supports sorting documents by a given
Sort
. This can be used to re-sort and index after it's been created by wrapping all
readers of the index with this reader and adding it to a fresh IndexWriter via
IndexWriter.addIndexes(CodecReader...)
.
NOTE: This reader should only be used for merging. Pulling fields from this reader might be very costly and memory
intensive.IndexReader.CacheHelper, IndexReader.CacheKey, IndexReader.ClosedListener
in
NULL_ACCOUNTABLE
Modifier and Type | Method and Description |
---|---|
IndexReader.CacheHelper |
getCoreCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this leaf regardless of deletions. |
DocValuesProducer |
getDocValuesReader()
Expert: retrieve underlying DocValuesProducer
|
StoredFieldsReader |
getFieldsReader()
Expert: retrieve thread-private StoredFieldsReader
|
Bits |
getLiveDocs()
Returns the
Bits representing live (not
deleted) docs. |
LeafMetaData |
getMetaData()
Return metadata about this leaf.
|
NormsProducer |
getNormsReader()
Expert: retrieve underlying NormsProducer
|
PointsReader |
getPointsReader()
Expert: retrieve underlying PointsReader
|
FieldsProducer |
getPostingsReader()
Expert: retrieve underlying FieldsProducer
|
IndexReader.CacheHelper |
getReaderCacheHelper()
Optional method: Return a
IndexReader.CacheHelper that can be used to cache
based on the content of this reader. |
TermVectorsReader |
getTermVectorsReader()
Expert: retrieve thread-private TermVectorsReader
|
String |
toString() |
static CodecReader |
wrap(CodecReader reader,
Sort sort)
Return a sorted view of
reader according to the order
defined by sort . |
checkIntegrity, doClose, getChildResources, getDelegate, getFieldInfos, maxDoc, numDocs, ramBytesUsed, unwrap
document, getBinaryDocValues, getNormValues, getNumericDocValues, getPointValues, getSortedDocValues, getSortedNumericDocValues, getSortedSetDocValues, getTermVectors, terms
docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, totalTermFreq
close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, tryIncRef
public static CodecReader wrap(CodecReader reader, Sort sort) throws IOException
reader
according to the order
defined by sort
. If the reader is already sorted, this
method might return the reader as-is.IOException
public FieldsProducer getPostingsReader()
CodecReader
getPostingsReader
in class FilterCodecReader
public StoredFieldsReader getFieldsReader()
CodecReader
getFieldsReader
in class FilterCodecReader
public Bits getLiveDocs()
LeafReader
Bits
representing live (not
deleted) docs. A set bit indicates the doc ID has not
been deleted. If this method returns null it means
there are no deleted documents (all documents are
live).
The returned instance has been safely published for
use by multiple threads without additional
synchronization.getLiveDocs
in class FilterCodecReader
public PointsReader getPointsReader()
CodecReader
getPointsReader
in class FilterCodecReader
public NormsProducer getNormsReader()
CodecReader
getNormsReader
in class FilterCodecReader
public DocValuesProducer getDocValuesReader()
CodecReader
getDocValuesReader
in class FilterCodecReader
public TermVectorsReader getTermVectorsReader()
CodecReader
getTermVectorsReader
in class FilterCodecReader
public IndexReader.CacheHelper getCoreCacheHelper()
LeafReader
IndexReader.CacheHelper
that can be used to cache
based on the content of this leaf regardless of deletions. Two readers
that have the same data but different sets of deleted documents or doc
values updates may be considered equal. Consider using
IndexReader.getReaderCacheHelper()
if you need deletions or dv updates to be
taken into account.
A return value of null
indicates that this reader is not suited
for caching, which is typically the case for short-lived wrappers that
alter the content of the wrapped leaf reader.
getCoreCacheHelper
in class LeafReader
public IndexReader.CacheHelper getReaderCacheHelper()
IndexReader
IndexReader.CacheHelper
that can be used to cache
based on the content of this reader. Two readers that have different data
or different sets of deleted documents will be considered different.
A return value of null
indicates that this reader is not suited
for caching, which is typically the case for short-lived wrappers that
alter the content of the wrapped reader.
getReaderCacheHelper
in class IndexReader
public LeafMetaData getMetaData()
LeafReader
getMetaData
in class FilterCodecReader
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.