I'm programatically building a combined query to use with the /v1/search
REST endpoint and I'm just a bit confused about the correct syntax for a combined query that contains a structured query. The combined query starts with a search
element and a query
element contains the structured query. The structured query example I coudl find start with a query
element and put the queries into a queries
array. So that means my combined query would look like:
{ "search": {
"query": {
"query": {
"queries": [
{"term-query":{"text":["foo"]}}
]
}
}
}}
So what I guess I'm really asking is it /search/query/query/queries[]
or is it /search/query/queries[]
?
The extra
query.queries
looks a bit odd, but it is conform syntax, and works. You can also drop theterm-query
(or any other query) directly undersearch.query
. This works too:HTH!