Package org.apache.lucene.search
Enum SortField.Type
- java.lang.Object
-
- java.lang.Enum<SortField.Type>
-
- org.apache.lucene.search.SortField.Type
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SortField.Type>
- Enclosing class:
- SortField
public static enum SortField.Type extends java.lang.Enum<SortField.Type>
Specifies the type of the terms to be sorted, or special types such as CUSTOM
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BYTE
Deprecated.BYTES
Sort use byte[] index values.CUSTOM
Sort using a custom Comparator.DOC
Sort by document number (index order).DOUBLE
Sort using term values as encoded Doubles.FLOAT
Sort using term values as encoded Floats.INT
Sort using term values as encoded Integers.LONG
Sort using term values as encoded Longs.REWRITEABLE
Force rewriting of SortField usingSortField.rewrite(IndexSearcher)
before it can be used for sortingSCORE
Sort by document score (relevance).SHORT
Deprecated.STRING
Sort using term values as Strings.STRING_VAL
Sort using term values as Strings, but comparing by value (using String.compareTo) for all comparisons.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SortField.Type
valueOf(java.lang.String name)
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 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.
-
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.
-
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.
-
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.
-
SHORT
@Deprecated public static final SortField.Type SHORT
Deprecated.Sort using term values as encoded Shorts. Sort values are Short and lower values are at the front.
-
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.
-
BYTE
@Deprecated public static final SortField.Type BYTE
Deprecated.Sort using term values as encoded Bytes. Sort values are Byte and lower values are at the front.
-
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 thanSTRING
, which uses ordinals to do the sorting.
-
BYTES
public static final SortField.Type BYTES
Sort use byte[] index values.
-
REWRITEABLE
public static final SortField.Type REWRITEABLE
Force rewriting of SortField usingSortField.rewrite(IndexSearcher)
before it can be used for 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(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-