Render a search application query Technical preview

POST /_application/search_application/{name}/_render_query

Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified. If a parameter used in the search template is not specified in params, the parameter's default value will be used. The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API.

You must have read privileges on the backing alias of the search application.

Path parameters

  • name string Required

    The name of the search application to render teh query for.

application/json

Body

  • params object
    Hide params attribute Show params attribute object
    • * object Additional properties

      Additional properties are allowed.

Responses

  • 200 application/json

    Additional properties are allowed.

POST /_application/search_application/{name}/_render_query
curl \
 -X POST http://api.example.com/_application/search_application/{name}/_render_query \
 -H "Content-Type: application/json" \
 -d '{"params":{"text_fields":[{"name":"title","boost":5},{"name":"description","boost":1}],"query_string":"my first query"}}'
Request example
Run `POST _application/search_application/my-app/_render_query` to generate a query for a search application called `my-app` that uses the search template.
{
  "params": {
    "text_fields": [
      {
        "name": "title",
        "boost": 5
      },
      {
        "name": "description",
        "boost": 1
      }
    ],
    "query_string": "my first query"
  }
}
Response examples (200)
{}