Class SearchTemplateRequest.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.RequestBase.AbstractBuilder<SearchTemplateRequest.Builder>
co.elastic.clients.elasticsearch.core.SearchTemplateRequest.Builder
- All Implemented Interfaces:
WithJson<SearchTemplateRequest.Builder>,ObjectBuilder<SearchTemplateRequest>
- Enclosing class:
- SearchTemplateRequest
public static class SearchTemplateRequest.Builder
extends RequestBase.AbstractBuilder<SearchTemplateRequest.Builder>
implements ObjectBuilder<SearchTemplateRequest>
Builder for
SearchTemplateRequest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowNoIndices(Boolean value) Iffalse, the request returns an error if any wildcard expression, index alias, or_allvalue targets only missing or closed indices.build()Builds aSearchTemplateRequest.ccsMinimizeRoundtrips(Boolean value) Iftrue, network round-trips are minimized for cross-cluster search requests.expandWildcards(ExpandWildcard value, ExpandWildcard... values) The type of index that wildcard patterns can match.expandWildcards(List<ExpandWildcard> list) The type of index that wildcard patterns can match.Iftrue, returns detailed information about score calculation as part of each hit.The ID of the search template to use.ignoreThrottled(Boolean value) Deprecated.7.16.0ignoreUnavailable(Boolean value) Iffalse, the request returns an error if it targets a missing or closed index.A comma-separated list of data streams, indices, and aliases to search.A comma-separated list of data streams, indices, and aliases to search.Key-value pairs used to replace Mustache variables in the template.Key-value pairs used to replace Mustache variables in the template.preference(String value) The node or shard the operation should be performed on.Iftrue, the query execution is profiled.projectRouting(String value) Specifies a subset of projects to target for the search using project metadata tags in a subset of Lucene query syntax.A custom value used to route operations to a specific shard.Specifies how long a consistent view of the index should be maintained for scrolled search.Specifies how long a consistent view of the index should be maintained for scrolled search.searchType(SearchType value) The type of the search operation.protected SearchTemplateRequest.Builderself()source(ScriptSource value) An inline search template.An inline search template.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowNoIndices
Iffalse, the request returns an error if any wildcard expression, index alias, or_allvalue 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 withfoobut 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
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_wildcardsAdds all elements of
listtoexpandWildcards. -
expandWildcards
public final SearchTemplateRequest.Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) 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_wildcardsAdds one or more values to
expandWildcards. -
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:
indexAdds all elements of
listtoindex. -
index
A comma-separated list of data streams, indices, and aliases to search. It supports wildcards (*).API name:
indexAdds one or more values to
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:
paramsAdds all entries of
maptoparams. -
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:
paramsAdds an entry to
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 -
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 -
source
public final SearchTemplateRequest.Builder source(Function<ScriptSource.Builder, ObjectBuilder<ScriptSource>> fn) 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 -
self
- Specified by:
selfin classRequestBase.AbstractBuilder<SearchTemplateRequest.Builder>
-
build
Builds aSearchTemplateRequest.- Specified by:
buildin interfaceObjectBuilder<SearchTemplateRequest>- Throws:
NullPointerException- if some of the required fields are null.
-