[[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]] === client.searchTemplate Run a search with a search template. {ref}/search-template.html[{es} documentation] [discrete] ==== Function signature [source,ts] ---- (SearchTemplateRequest, options?): Promise ---- [discrete] ==== Request [pass] ++++
++++
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
}

[pass]
++++
++++ [discrete] ==== Response [pass] ++++
++++
interface SearchTemplateResponse {
  took: <>
  timed_out: boolean
  _shards: <>
  hits: <>
  aggregations?: Record<<>, <>>
  _clusters?: <>
  fields?: Record
  max_score?: <>
  num_reduce_phases?: <>
  profile?: <>
  pit_id?: <>
  _scroll_id?: <>
  suggest?: Record<<>, <>[]>
  terminated_early?: boolean
}

[pass]
++++
++++