Package org.apache.lucene.index
Class IndexSorter.LongSorter
- java.lang.Object
-
- org.apache.lucene.index.IndexSorter.LongSorter
-
- All Implemented Interfaces:
IndexSorter
- Enclosing interface:
- IndexSorter
public static final class IndexSorter.LongSorter extends Object implements IndexSorter
Sorts documents based on long values from a NumericDocValues instance
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.lucene.index.IndexSorter
IndexSorter.ComparableProvider, IndexSorter.DocComparator, IndexSorter.DoubleSorter, IndexSorter.FloatSorter, IndexSorter.IntSorter, IndexSorter.LongSorter, IndexSorter.NumericDocValuesProvider, IndexSorter.SortedDocValuesProvider, IndexSorter.StringSorter
-
-
Constructor Summary
Constructors Constructor Description LongSorter(String providerName, Long missingValue, boolean reverse, IndexSorter.NumericDocValuesProvider valuesProvider)Creates a new LongSorter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexSorter.ComparableProvider[]getComparableProviders(List<? extends LeafReader> readers)Get an array ofIndexSorter.ComparableProvider, one per segment, for merge sorting documents in different segmentsIndexSorter.DocComparatorgetDocComparator(LeafReader reader, int maxDoc)Get a comparator that determines the sort order of docs within a single Reader.StringgetProviderName()The SPI-registered name of aSortFieldProviderthat will deserialize the parent SortField
-
-
-
Constructor Detail
-
LongSorter
public LongSorter(String providerName, Long missingValue, boolean reverse, IndexSorter.NumericDocValuesProvider valuesProvider)
Creates a new LongSorter
-
-
Method Detail
-
getComparableProviders
public IndexSorter.ComparableProvider[] getComparableProviders(List<? extends LeafReader> readers) throws IOException
Description copied from interface:IndexSorterGet an array ofIndexSorter.ComparableProvider, one per segment, for merge sorting documents in different segments- Specified by:
getComparableProvidersin interfaceIndexSorter- Parameters:
readers- the readers to be merged- Throws:
IOException
-
getDocComparator
public IndexSorter.DocComparator getDocComparator(LeafReader reader, int maxDoc) throws IOException
Description copied from interface:IndexSorterGet a comparator that determines the sort order of docs within a single Reader.NB We cannot simply use the
FieldComparatorAPI 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 segments- Specified by:
getDocComparatorin interfaceIndexSorter- Parameters:
reader- the Reader to sortmaxDoc- the number of documents in the Reader- Throws:
IOException
-
getProviderName
public String getProviderName()
Description copied from interface:IndexSorterThe SPI-registered name of aSortFieldProviderthat will deserialize the parent SortField- Specified by:
getProviderNamein interfaceIndexSorter
-
-