Class SearchTemplateRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.SearchTemplateRequest
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class SearchTemplateRequest
extends RequestBase
implements JsonpSerializable
Runs a search with a search template.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JsonpDeserializer<SearchTemplateRequest>
Json deserializer forSearchTemplateRequest
static final SimpleEndpoint<SearchTemplateRequest,
?> Endpoint "search_template
". -
Method Summary
Modifier and TypeMethodDescriptionfinal Boolean
Iffalse
, the request returns an error if any wildcard expression, index alias, or_all
value targets only missing or closed indices.final Boolean
Iftrue
, network round-trips are minimized for cross-cluster search requests.static <TDocument>
Endpoint<SearchTemplateRequest,SearchTemplateResponse<TDocument>, ErrorResponse> createSearchTemplateEndpoint
(JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "search_template
" endpoint.final List<ExpandWildcard>
Type of index that wildcard patterns can match.final Boolean
explain()
Iftrue
, returns detailed information about score calculation as part of each hit.final String
id()
ID of the search template to use.final Boolean
Iftrue
, specified concrete, expanded, or aliased indices are not included in the response when throttled.final Boolean
Iffalse
, the request returns an error if it targets a missing or closed index.index()
Comma-separated list of data streams, indices, and aliases to search.static SearchTemplateRequest
params()
Key-value pairs used to replace Mustache variables in the template.final String
Specifies the node or shard the operation should be performed on.final Boolean
profile()
Iftrue
, the query execution is profiled.final String
routing()
Custom value used to route operations to a specific shard.final Time
scroll()
Specifies how long a consistent view of the index should be maintained for scrolled search.final SearchType
The type of the search operation.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final String
source()
An inline search template.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forSearchTemplateRequest
-
_ENDPOINT
Endpoint "search_template
".
-
-
Method Details
-
of
public static SearchTemplateRequest of(Function<SearchTemplateRequest.Builder, ObjectBuilder<SearchTemplateRequest>> fn) -
allowNoIndices
Iffalse
, the request returns an error if any wildcard expression, index alias, or_all
value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targetingfoo*,bar*
returns an error if an index starts withfoo
but no index starts withbar
.API name:
allow_no_indices
-
ccsMinimizeRoundtrips
Iftrue
, network round-trips are minimized for cross-cluster search requests.API name:
ccs_minimize_roundtrips
-
expandWildcards
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such asopen,hidden
. Valid values are:all
,open
,closed
,hidden
,none
.API name:
expand_wildcards
-
explain
Iftrue
, returns detailed information about score calculation as part of each hit.API name:
explain
-
id
ID of the search template to use. If no source is specified, this parameter is required.API name:
id
-
ignoreThrottled
Iftrue
, specified concrete, expanded, or aliased indices are not included in the response when throttled.API name:
ignore_throttled
-
index
Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*).API name:
index
-
params
Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value.API name:
params
-
preference
Specifies the node or shard the operation should be performed on. Random by default.API name:
preference
-
profile
Iftrue
, the query execution is profiled.API name:
profile
-
routing
Custom value used to route operations to a specific shard.API name:
routing
-
scroll
Specifies how long a consistent view of the index should be maintained for scrolled search.API name:
scroll
-
searchType
The type of the search operation.API name:
search_type
-
source
An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required.API name:
source
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupSearchTemplateRequestDeserializer
protected static void setupSearchTemplateRequestDeserializer(ObjectDeserializer<SearchTemplateRequest.Builder> op) -
createSearchTemplateEndpoint
public static <TDocument> Endpoint<SearchTemplateRequest,SearchTemplateResponse<TDocument>, createSearchTemplateEndpointErrorResponse> (JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "search_template
" endpoint.
-