Path parameters
- name
string Required The name of the search application to render teh query for.
POST /_application/search_application/{name}/_render_query
Console
POST _application/search_application/my-app/_render_query
{
"params": {
"query_string": "my first query",
"text_fields": [
{
"name": "title",
"boost": 5
},
{
"name": "description",
"boost": 1
}
]
}
}
curl \
--request POST 'http://api.example.com/_application/search_application/{name}/_render_query' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '"{\n \"params\": {\n \"query_string\": \"my first query\",\n \"text_fields\": [\n {\n \"name\": \"title\",\n \"boost\": 5\n },\n {\n \"name\": \"description\",\n \"boost\": 1\n }\n ]\n }\n}"'
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": {
"query_string": "my first query",
"text_fields": [
{
"name": "title",
"boost": 5
},
{
"name": "description",
"boost": 1
}
]
}
}
Response examples (200)
A successful response for generating a query for a search application. The `from`, `size`, and `explain` parameters were not specified in the request, so the default values specified in the search template are used.
{
"from": 0,
"size": 10,
"query": {
"multi_match": {
"query": "my first query",
"fields": [
"description^1.0",
"title^5.0"
]
}
},
"explain": false
}