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
Run a search with a search template.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<SearchTemplateRequest>Json deserializer forSearchTemplateRequeststatic final SimpleEndpoint<SearchTemplateRequest,?> Endpoint "search_template". -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanA setting that does two separate checks on the index expression.final BooleanIndicates whether network round-trips should be minimized as part of cross-cluster search requests execution.static <TDocument>
Endpoint<SearchTemplateRequest,SearchTemplateResponse<TDocument>, ErrorResponse> createSearchTemplateEndpoint(JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "search_template" endpoint.final List<ExpandWildcard>The type of index that wildcard patterns can match.final Booleanexplain()Iftrue, returns detailed information about score calculation as part of each hit.final Stringid()The ID of the search template to use.final BooleanDeprecated.7.16.0final BooleanIffalse, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable.index()A comma-separated list of data streams, indices, and aliases to search.static SearchTemplateRequestparams()Key-value pairs used to replace Mustache variables in the template.final StringThe node or shard the operation should be performed on.final Booleanprofile()Iftrue, the query execution is profiled.final StringSpecifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax.rebuild()routing()A custom value used to route operations to a specific shard.final Timescroll()Specifies how long a consistent view of the index should be maintained for scrolled search.final SearchTypeThe type of the search operation.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal ScriptSourcesource()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
A setting that does two separate checks on the index expression. Iffalse, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result.API name:
allow_no_indices -
ccsMinimizeRoundtrips
Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.API name:
ccs_minimize_roundtrips -
expandWildcards
The 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.API name:
expand_wildcards -
explain
Iftrue, returns detailed information about score calculation as part of each hit. If you specify both this and theexplainquery parameter, the API uses only the query parameter.API name:
explain -
id
The ID of the search template to use. If nosourceis specified, this parameter is required.API name:
id -
ignoreThrottled
Deprecated.7.16.0Iftrue, specified concrete, expanded, or aliased indices are not included in the response when throttled.API name:
ignore_throttled -
index
A comma-separated list of data streams, indices, and aliases to search. It 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
The node or shard the operation should be performed on. It is random by default.API name:
preference -
profile
Iftrue, the query execution is profiled.API name:
profile -
projectRouting
Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded). Examples: _alias:my-project _alias:_origin _alias:pr Supported in serverless only.API name:
project_routing -
routing
A 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. It also supports Mustache variables. If noidis specified, this parameter is required.API name:
source -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
rebuild
- Returns:
- New
SearchTemplateRequest.Builderinitialized with field values of this instance
-
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.
-