Class IndexSorter.LongSorter

  • All Implemented Interfaces:
    IndexSorter
    Enclosing interface:
    IndexSorter

    public static final class IndexSorter.LongSorter
    extends java.lang.Object
    implements IndexSorter
    Sorts documents based on long values from a NumericDocValues instance
    • Field Detail

      • providerName

        private final java.lang.String providerName
      • missingValue

        private final java.lang.Long missingValue
      • reverseMul

        private final int reverseMul
    • Constructor Detail

      • LongSorter

        public LongSorter​(java.lang.String providerName,
                          java.lang.Long missingValue,
                          boolean reverse,
                          IndexSorter.NumericDocValuesProvider valuesProvider)
        Creates a new LongSorter
    • Method Detail

      • getDocComparator

        public IndexSorter.DocComparator getDocComparator​(LeafReader reader,
                                                          int maxDoc)
                                                   throws java.io.IOException
        Description copied from interface: IndexSorter
        Get a comparator that determines the sort order of docs within a single Reader.

        NB We cannot simply use the 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 segments

        Specified by:
        getDocComparator in interface IndexSorter
        Parameters:
        reader - the Reader to sort
        maxDoc - the number of documents in the Reader
        Throws:
        java.io.IOException