Enum SortField.Type

    • Enum Constant Detail

      • SCORE

        public static final SortField.Type SCORE
        Sort by document score (relevance). Sort values are Float and higher values are at the front.
      • DOC

        public static final SortField.Type DOC
        Sort by document number (index order). Sort values are Integer and lower values are at the front.
      • STRING

        public static final SortField.Type STRING
        Sort using term values as Strings. Sort values are String and lower values are at the front.
      • INT

        public static final SortField.Type INT
        Sort using term values as encoded Integers. Sort values are Integer and lower values are at the front. Fields must either be not indexed, or indexed with IntPoint.
      • FLOAT

        public static final SortField.Type FLOAT
        Sort using term values as encoded Floats. Sort values are Float and lower values are at the front. Fields must either be not indexed, or indexed with FloatPoint.
      • LONG

        public static final SortField.Type LONG
        Sort using term values as encoded Longs. Sort values are Long and lower values are at the front. Fields must either be not indexed, or indexed with LongPoint.
      • DOUBLE

        public static final SortField.Type DOUBLE
        Sort using term values as encoded Doubles. Sort values are Double and lower values are at the front. Fields must either be not indexed, or indexed with DoublePoint.
      • CUSTOM

        public static final SortField.Type CUSTOM
        Sort using a custom Comparator. Sort values are any Comparable and sorting is done according to natural order.
      • STRING_VAL

        public static final SortField.Type STRING_VAL
        Sort using term values as Strings, but comparing by value (using String.compareTo) for all comparisons. This is typically slower than STRING, which uses ordinals to do the sorting.
    • Method Detail

      • values

        public static SortField.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SortField.Type c : SortField.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SortField.Type valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null