searchTemplate

edit
client.searchTemplate({
  index: string | string[],
  type: string | string[],
  ignore_unavailable: boolean,
  allow_no_indices: boolean,
  expand_wildcards: 'open' | 'closed' | 'none' | 'all',
  preference: string,
  routing: string | string[],
  scroll: string,
  search_type: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch',
  explain: boolean,
  profile: boolean,
  typed_keys: boolean,
  body: object
})

Reference

index

string | string[] - A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices

type

string | string[] - A comma-separated list of document types to search; leave empty to perform the operation on all types

ignore_unavailable or ignoreUnavailable

boolean - Whether specified concrete indices should be ignored when unavailable (missing or closed)

allow_no_indices or allowNoIndices

boolean - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

expand_wildcards or expandWildcards

'open' | 'closed' | 'none' | 'all' - Whether to expand wildcard expression to concrete indices that are open, closed or both.
Default: open

preference

string - Specify the node or shard the operation should be performed on (default: random)

routing

string | string[] - A comma-separated list of specific routing values

scroll

string - Specify how long a consistent view of the index should be maintained for scrolled search

search_type or searchType

'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch' - Search operation type

explain

boolean - Specify whether to return detailed information about score computation as part of a hit

profile

boolean - Specify whether to profile the query execution

typed_keys or typedKeys

boolean - Specify whether aggregation and suggester names should be prefixed by their respective types in the response

body

object - The search definition template and its params