Body
-
id
string -
file
string -
params
object Key-value pairs used to replace Mustache variables in the template. The key is the variable name. The value is the variable value.
-
source
string An inline search template. It supports the same parameters as the search API's request body. These parameters also support Mustache variables. If no
id
or<templated-id>
is specified, this parameter is required.
GET
/_render/template
curl \
--request GET 'http://api.example.com/_render/template' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"id\": \"my-search-template\",\n \"params\": {\n \"query_string\": \"hello world\",\n \"from\": 20,\n \"size\": 10\n }\n}"'
Request example
Run `POST _render/template`
{
"id": "my-search-template",
"params": {
"query_string": "hello world",
"from": 20,
"size": 10
}
}
Response examples (200)
{
"template_output": {
"additionalProperty1": {},
"additionalProperty2": {}
}
}