Skip to content

Query validation doesn't work consistently on inner queries #38801

@darinakl

Description

@darinakl

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:

  1. {"query":{"query_string":{"query":"abc AND"}}}
  2. {"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:

  1. 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"}}}'

  2. 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"}}]}}}'

  3. 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"}}]}}}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Foundations/SearchCatch all for Search Foundations>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions