Run a search application search
Beta; Added in 8.8.0
Generate and run an Elasticsearch query that uses the specified query parameteter and the search template associated with the search application or default template. Unspecified template parameters are assigned their default values if applicable.
Query parameters
-
Determines whether aggregation names are prefixed by their respective types in the response.
GET
/_application/search_application/{name}/_search
Console
POST _application/search_application/my-app/_search
{
"params": {
"query_string": "my first query",
"text_fields": [
{"name": "title", "boost": 5},
{"name": "description", "boost": 1}
]
}
}
resp = client.search_application.search(
name="my-app",
params={
"query_string": "my first query",
"text_fields": [
{
"name": "title",
"boost": 5
},
{
"name": "description",
"boost": 1
}
]
},
)
const response = await client.searchApplication.search({
name: "my-app",
params: {
query_string: "my first query",
text_fields: [
{
name: "title",
boost: 5,
},
{
name: "description",
boost: 1,
},
],
},
});
response = client.search_application.search(
name: "my-app",
body: {
"params": {
"query_string": "my first query",
"text_fields": [
{
"name": "title",
"boost": 5
},
{
"name": "description",
"boost": 1
}
]
}
}
)
$resp = $client->searchApplication()->search([
"name" => "my-app",
"body" => [
"params" => [
"query_string" => "my first query",
"text_fields" => array(
[
"name" => "title",
"boost" => 5,
],
[
"name" => "description",
"boost" => 1,
],
),
],
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"params":{"query_string":"my first query","text_fields":[{"name":"title","boost":5},{"name":"description","boost":1}]}}' "$ELASTICSEARCH_URL/_application/search_application/my-app/_search"
Request example
Use `POST _application/search_application/my-app/_search` to run a search against a search application called `my-app` that uses a search template.
{
"params": {
"query_string": "my first query",
"text_fields": [
{"name": "title", "boost": 5},
{"name": "description", "boost": 1}
]
}
}