Render Search Application Queryedit
This functionality is in technical preview and may be changed or removed in a future release. Elastic will apply best effort to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
Given specified query parameters, creates an Elasticsearch query to run. Any unspecified template parameters will be assigned their default values if applicable. Returns the specific Elasticsearch query that would be generated and run by calling search application search.
Requestedit
POST _application/search_application/<name>/_render_query
Prerequisitesedit
Requires read privileges on the backing alias of the search application.
Request bodyedit
-
params
- (Optional, map of strings to objects) Query parameters specific to this request, which will override any defaults specified in the template.
Response codesedit
-
404
-
Search Application
<name>
does not exist.
Examplesedit
The following example renders a query for a search application called my-app
. In this case, the from
and size
parameters are not specified, so default values are pulled from the search application template.
POST _application/search_application/my-app/_render_query { "params": { "query_string": "my first query", "text_fields": [ { "name": "title", "boost": 10 }, { "name": "text", "boost": 1 } ] } }
A sample response:
{ "from": 0, "size": 10, "query": { "multi_match": { "query": "my first query", "fields": [ "text^1.0", "title^10.0" ] } }, "explain": false }