public interface IndexSorter
getDocComparator(LeafReader,int)
- an object that determines how documents within a segment are to be sorted
getComparableProviders(List)
- an array of objects that return a sortable long value per document and segment
getProviderName()
- the SPI-registered name of a SortFieldProvider
to serialize the sort
The companion SortFieldProvider
should be registered with SPI via META-INF/services
Modifier and Type | Interface and Description |
---|---|
static interface |
IndexSorter.ComparableProvider
Used for sorting documents across segments
|
static interface |
IndexSorter.DocComparator
A comparator of doc IDs, used for sorting documents within a segment
|
static class |
IndexSorter.DoubleSorter
Sorts documents based on double values from a NumericDocValues instance
|
static class |
IndexSorter.FloatSorter
Sorts documents based on float values from a NumericDocValues instance
|
static class |
IndexSorter.IntSorter
Sorts documents based on integer values from a NumericDocValues instance
|
static class |
IndexSorter.LongSorter
Sorts documents based on long values from a NumericDocValues instance
|
static interface |
IndexSorter.NumericDocValuesProvider
Provide a NumericDocValues instance for a LeafReader
|
static interface |
IndexSorter.SortedDocValuesProvider
Provide a SortedDocValues instance for a LeafReader
|
static class |
IndexSorter.StringSorter
Sorts documents based on terms from a SortedDocValues instance
|
Modifier and Type | Method and Description |
---|---|
IndexSorter.ComparableProvider[] |
getComparableProviders(List<? extends LeafReader> readers)
Get an array of
IndexSorter.ComparableProvider , one per segment, for merge sorting documents in different segments |
IndexSorter.DocComparator |
getDocComparator(LeafReader reader,
int maxDoc)
Get a comparator that determines the sort order of docs within a single Reader.
|
String |
getProviderName()
The SPI-registered name of a
SortFieldProvider that will deserialize the parent SortField |
IndexSorter.ComparableProvider[] getComparableProviders(List<? extends LeafReader> readers) throws IOException
IndexSorter.ComparableProvider
, one per segment, for merge sorting documents in different segmentsreaders
- the readers to be mergedIOException
IndexSorter.DocComparator getDocComparator(LeafReader reader, int maxDoc) throws IOException
FieldComparator
API because it requires docIDs to be sent
in-order. The default implementations allocate array[maxDoc] to hold native values for comparison,
but 1) they are transient (only alive while sorting this one segment) and 2) in the typical
index sorting case, they are only used to sort newly flushed segments, which will be smaller
than merged segmentsreader
- the Reader to sortmaxDoc
- the number of documents in the ReaderIOException
String getProviderName()
SortFieldProvider
that will deserialize the parent SortFieldCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.