Package org.elasticsearch.action.search
Enum Class SearchType
- All Implemented Interfaces:
Serializable
,Comparable<SearchType>
,Constable
Search type represent the manner at which the search operation is executed.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSame asQUERY_THEN_FETCH
, except for an initial scatter phase which goes and computes the distributed term frequencies for more accurate scoring.The query is executed against all shards, but only enough information is returned (not the document content). -
Field Summary
Modifier and TypeFieldDescriptionstatic SearchType[]
Non-deprecated typesstatic SearchType
The default search type (QUERY_THEN_FETCH
. -
Method Summary
Modifier and TypeMethodDescriptionstatic SearchType
fromId(byte id)
Constructs search type based on the internal id.static SearchType
fromString(String searchType)
The a string representation search type to execute, defaults toDEFAULT
.byte
id()
The internal id of the type.static SearchType
Returns the enum constant of this class with the specified name.static SearchType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DFS_QUERY_THEN_FETCH
Same asQUERY_THEN_FETCH
, except for an initial scatter phase which goes and computes the distributed term frequencies for more accurate scoring. -
QUERY_THEN_FETCH
The query is executed against all shards, but only enough information is returned (not the document content). The results are then sorted and ranked, and based on it, only the relevant shards are asked for the actual document content. The return number of hits is exactly as specified in size, since they are the only ones that are fetched. This is very handy when the index has a lot of shards (not replicas, shard id groups).
-
-
Field Details
-
DEFAULT
The default search type (QUERY_THEN_FETCH
. -
CURRENTLY_SUPPORTED
Non-deprecated types
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
id
public byte id()The internal id of the type. -
fromId
Constructs search type based on the internal id. -
fromString
The a string representation search type to execute, defaults toDEFAULT
. Can be one of "dfs_query_then_fetch" or "query_then_fetch".
-