org.elasticsearch.action.terms
Enum TermsRequest.SortType

java.lang.Object
  extended by java.lang.Enum<TermsRequest.SortType>
      extended by org.elasticsearch.action.terms.TermsRequest.SortType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TermsRequest.SortType>
Enclosing class:
TermsRequest

public static enum TermsRequest.SortType
extends java.lang.Enum<TermsRequest.SortType>

The type of sorting for terms.


Enum Constant Summary
FREQ
          Sort based on the term document frequency.
TERM
          Sort based on the term (lex).
 
Method Summary
static TermsRequest.SortType fromString(java.lang.String value, TermsRequest.SortType defaultSort)
          Parses the sort type from a string.
static TermsRequest.SortType fromValue(byte value)
          Parses the sort type from its value().
 byte value()
          The unique byte value of the sort type.
static TermsRequest.SortType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TermsRequest.SortType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TERM

public static final TermsRequest.SortType TERM
Sort based on the term (lex).


FREQ

public static final TermsRequest.SortType FREQ
Sort based on the term document frequency.

Method Detail

values

public static TermsRequest.SortType[] 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 (TermsRequest.SortType c : TermsRequest.SortType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TermsRequest.SortType 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 name
java.lang.NullPointerException - if the argument is null

value

public byte value()
The unique byte value of the sort type.


fromValue

public static TermsRequest.SortType fromValue(byte value)
Parses the sort type from its value().


fromString

public static TermsRequest.SortType fromString(java.lang.String value,
                                               TermsRequest.SortType defaultSort)
Parses the sort type from a string. Can either be "term" or "freq". If null is passed, will return the defaultSort provided.

Parameters:
value - The string value to parse. Can be either "term" or "freq"
defaultSort - The sort type to return in case value is null
Returns:
The sort type parsed