Package org.apache.lucene.search
Enum SortField.Type
- All Implemented Interfaces:
Serializable
,Comparable<SortField.Type>
- Enclosing class:
- SortField
Specifies the type of the terms to be sorted, or special types such as CUSTOM
-
Enum Constant Summary
Enum ConstantDescriptionSort using a custom Comparator.Sort by document number (index order).Sort using term values as encoded Doubles.Sort using term values as encoded Floats.Sort using term values as encoded Integers.Sort using term values as encoded Longs.Force rewriting of SortField usingSortField.rewrite(IndexSearcher)
before it can be used for sortingSort by document score (relevance).Sort using term values as Strings.Sort using term values as Strings, but comparing by value (using String.compareTo) for all comparisons. -
Method Summary
Modifier and TypeMethodDescriptionstatic SortField.Type
Returns the enum constant of this type with the specified name.static SortField.Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SCORE
Sort by document score (relevance). Sort values are Float and higher values are at the front. -
DOC
Sort by document number (index order). Sort values are Integer and lower values are at the front. -
STRING
Sort using term values as Strings. Sort values are String and lower values are at the front. -
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 withIntPoint
. -
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 withFloatPoint
. -
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 withLongPoint
. -
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 withDoublePoint
. -
CUSTOM
Sort using a custom Comparator. Sort values are any Comparable and sorting is done according to natural order. -
STRING_VAL
Sort using term values as Strings, but comparing by value (using String.compareTo) for all comparisons. This is typically slower thanSTRING
, which uses ordinals to do the sorting. -
REWRITEABLE
Force rewriting of SortField usingSortField.rewrite(IndexSearcher)
before it can be used for sorting
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-