[[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 || || || || || || || =========================================================================================================================== //////// [discrete] === client.searchTemplate Run a search with a search template. {ref}/search-template.html[{es} documentation] [discrete] ==== Function signature [source,ts] ---- (SearchTemplateRequest, options?): Promise ---- [discrete] ===== `SearchTemplateRequest` [source,ts] ---- interface SearchTemplateRequest extends <> { index?: <> allow_no_indices?: boolean ccs_minimize_roundtrips?: boolean expand_wildcards?: <> ignore_throttled?: boolean ignore_unavailable?: boolean preference?: string routing?: <> scroll?: <> search_type?: <> rest_total_hits_as_int?: boolean typed_keys?: boolean explain?: boolean id?: <> params?: Record profile?: boolean source?: string } ---- [discrete] ===== `SearchTemplateResponse` [source,ts] ---- interface SearchTemplateResponse { took: <> timed_out: boolean _shards: <> hits: SearchHitsMetadata aggregations?: Record<<>, AggregationsAggregate> _clusters?: <> fields?: Record max_score?: <> num_reduce_phases?: <> profile?: SearchProfile pit_id?: <> _scroll_id?: <> suggest?: Record<<>, SearchSuggest[]> terminated_early?: boolean } ----