102 lines
4.7 KiB
Plaintext
102 lines
4.7 KiB
Plaintext
[[reference-search_template]]
|
|
|
|
////////
|
|
===========================================================================================================================
|
|
|| ||
|
|
|| ||
|
|
|| ||
|
|
|| ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ ||
|
|
|| ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ ||
|
|
|| ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ ||
|
|
|| ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ||
|
|
|| ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ ||
|
|
|| ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ||
|
|
|| ||
|
|
|| ||
|
|
|| This file is autogenerated, DO NOT send pull requests that changes this file directly. ||
|
|
|| You should update the script that does the generation, which can be found in: ||
|
|
|| https://github.com/elastic/elastic-client-generator-js ||
|
|
|| ||
|
|
|| You can run the script with the following command: ||
|
|
|| npm run elasticsearch -- --version <version> ||
|
|
|| ||
|
|
|| ||
|
|
|| ||
|
|
===========================================================================================================================
|
|
////////
|
|
|
|
[discrete]
|
|
=== client.searchTemplate
|
|
|
|
Run a search with a search template.
|
|
|
|
{ref}/search-template.html[{es} documentation]
|
|
|
|
[discrete]
|
|
==== Function signature
|
|
|
|
[source,ts]
|
|
----
|
|
(SearchTemplateRequest, options?): Promise<SearchTemplateResponse>
|
|
----
|
|
|
|
[discrete]
|
|
==== SearchTemplateRequest
|
|
|
|
[pass]
|
|
++++
|
|
<pre>
|
|
++++
|
|
interface SearchTemplateRequest extends <<RequestBase>> {
|
|
index?: <<Indices>>
|
|
allow_no_indices?: boolean
|
|
ccs_minimize_roundtrips?: boolean
|
|
expand_wildcards?: <<ExpandWildcards>>
|
|
ignore_throttled?: boolean
|
|
ignore_unavailable?: boolean
|
|
preference?: string
|
|
routing?: <<Routing>>
|
|
scroll?: <<Duration>>
|
|
search_type?: <<SearchType>>
|
|
rest_total_hits_as_int?: boolean
|
|
typed_keys?: boolean
|
|
explain?: boolean
|
|
id?: <<Id>>
|
|
params?: Record<string, any>
|
|
profile?: boolean
|
|
source?: string
|
|
}
|
|
|
|
[pass]
|
|
++++
|
|
</pre>
|
|
++++
|
|
[discrete]
|
|
==== SearchTemplateResponse
|
|
|
|
[pass]
|
|
++++
|
|
<pre>
|
|
++++
|
|
interface SearchTemplateResponse<TDocument = unknown> {
|
|
took: <<_long, long>>
|
|
timed_out: boolean
|
|
_shards: <<ShardStatistics>>
|
|
hits: SearchHitsMetadata<TDocument>
|
|
aggregations?: Record<<<AggregateName>>, AggregationsAggregate>
|
|
_clusters?: <<ClusterStatistics>>
|
|
fields?: Record<string, any>
|
|
max_score?: <<_double, double>>
|
|
num_reduce_phases?: <<_long, long>>
|
|
profile?: SearchProfile
|
|
pit_id?: <<Id>>
|
|
_scroll_id?: <<ScrollId>>
|
|
suggest?: Record<<<SuggestionName>>, SearchSuggest<TDocument>[]>
|
|
terminated_early?: boolean
|
|
}
|
|
|
|
[pass]
|
|
++++
|
|
</pre>
|
|
++++
|