Run multiple templated searches Added in 5.0.0
Path parameters
-
Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (
*
). To search all data streams and indices, omit this parameter or use*
.
Query parameters
-
ccs_minimize_roundtrips boolean
If
true
, network round-trips are minimized for cross-cluster search requests. -
max_concurrent_searches number
Maximum number of concurrent searches the API can run.
-
search_type string
The type of the search operation. Available options:
query_then_fetch
,dfs_query_then_fetch
.Values are
query_then_fetch
ordfs_query_then_fetch
. -
rest_total_hits_as_int boolean
If
true
, the response returnshits.total
as an integer. Iffalse
, it returnshits.total
as an object. -
typed_keys boolean
If
true
, the response prefixes aggregation and suggester names with their respective types.
POST /{index}/_msearch/template
curl \
-X POST http://api.example.com/{index}/_msearch/template \
-H "Content-Type: application/json" \
-d '[{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"index":"string","preference":"string","request_cache":true,"routing":"string","search_type":"query_then_fetch","ccs_minimize_roundtrips":true,"allow_partial_search_results":true,"ignore_throttled":true}]'