Skip to content

Files

Latest commit

 

History

History
89 lines (73 loc) · 2.12 KB

render-search-template-api.asciidoc

File metadata and controls

89 lines (73 loc) · 2.12 KB

Render search template API

Render search template
POST _render/template
{
  "id": "my-search-template",
  "params": {
    "query_string": "hello world",
    "from": 20,
    "size": 10
  }
}

{api-request-title}

GET _render/template

GET _render/template/<template-id>

POST _render/template

POST _render/template/<template-id>

{api-prereq-title}

  • If the {es} {security-features} are enabled, you must have the read index privilege for at least one index pattern.

{api-path-parms-title}

<template-id>

(Required*, string) ID of the search template to render. If no source is specified, this or the id request body parameter is required.

{api-request-body-title}

id

(Required*, string) ID of the search template to render. If no source is specified, this or the <template-id> request path parameter is required. If you specify both this parameter and the <template-id> parameter, the API uses only <template-id>.

params

(Optional, 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

(Required*, object) An inline search template. 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.