-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Elasticsearch version: 5.6.9
When using validate API with inner queries returned results are not consistent:
The following queries, according to the API, are invalid:
- {"query":{"query_string":{"query":"abc AND"}}}
- {"query":{"bool":{"must":[{"query_string":{"query":"abc AND"}}]}}}
Although this one(when filter is added) is valid:
3. {"query":{"bool":{"filter":[{"range":{"@timestamp":{"lt":1549993646000,"gte":1549992746000}}}],"must":[{"query_string":{"query":"abc AND"}}]}}}
Steps to reproduce:
-
curl -X POST
'localhost:9200/my_index/_validate/query?explain=true&ignore_unavailable=true'
-H 'Content-Type: application/json'
-d '{"query":{"query_string":{"query":"abc AND"}}}' -
curl -X POST
'localhost:9200/my_index/_validate/query?explain=true&ignore_unavailable=true'
-H 'Content-Type: application/json'
-d '{"query":{"bool":{"must":[{"query_string":{"query":"abc AND"}}]}}}' -
curl -X POST
'localhost:9200/my_index/_validate/query?explain=true&ignore_unavailable=true'
-H 'Content-Type: application/json'
-d '{"query":{"bool":{"filter":[{"range":{"@timestamp":{"lt":1549993646000,"gte":1549992746000}}}],"must":[{"query_string":{"query":"abc AND"}}]}}}'