younifyd
Menu

Run a search with a search template (GET /{index}/_search/template)

Run a search with a search template

GET/{index}/_search/template

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Run a search with a search template (GET /{index}/_search/template) action (under search).
  3. Fill in the fields below, then reference the result from later steps as {{runASearchWithASearchTemplateGetIndexSearchTemplate.response.data}}.

Request

Path parameters

indexoneOfrequired

A comma-separated list of data streams, indices, and aliases to search. It supports wildcards (`*`).

Query parameters

allow_no_indicesboolean

A setting that does two separate checks on the index expression. If `false`, the request returns an error (1) if any wildcard expression (including `_all` and `*`) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. If `true`, index expressions that resolve to no indices are allowed and the request returns an empty result.

ccs_minimize_roundtripsboolean

Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution.

expand_wildcardsoneOf

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 as `open,hidden`.

explainboolean

If `true`, the response includes additional details about score computation as part of a hit.

ignore_throttledboolean

If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled.

ignore_unavailableboolean

If `false`, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. If `true`, unavailable concrete targets are silently ignored.

preferencestring

The node or shard the operation should be performed on. It is random by default.

profileboolean

If `true`, the query execution is profiled.

routingoneOf

A custom value used to route operations to a specific shard.

scrolloneOf

Specifies how long a consistent view of the index should be maintained for scrolled search.

search_typestring

The type of the search operation.

One ofquery_then_fetchdfs_query_then_fetch

rest_total_hits_as_intboolean

If `true`, `hits.total` is rendered as an integer in the response. If `false`, it is rendered as an object.

typed_keysboolean

If `true`, the response prefixes aggregation and suggester names with their respective types.

Response

Returns 200 with an object. Read it in later steps with {{runASearchWithASearchTemplateGetIndexSearchTemplate.response.data.<field>}}.

tooknumber
timed_outboolean
_shardsany
hitsany
aggregationsobject
_clustersany
fieldsobject
max_scorenumber
num_reduce_phasesnumber
profileany
pit_idany
_scroll_idany
suggestobject
terminated_earlyboolean
json
{
  "took": 0,
  "timed_out": false,
  "_shards": null,
  "hits": null,
  "aggregations": {},
  "_clusters": null,
  "fields": {},
  "max_score": 0,
  "num_reduce_phases": 0,
  "profile": null,
  "pit_id": null,
  "_scroll_id": null
}

Need more? See the Elasticsearch guide for connection setup and behaviour shared by every action.

Run a search with a search template (GET /{index}/_search/template) — Elasticsearch — Documentation