Is there any documentation about the query query?

This is a normal term query:

{
  "query": {
    "term" : { "user" : "Kimchy" } 
  }
}

I just found out that this is also a valid query:

{
  "query": {
    "query": {
      "term" : { "user" : "Kimchy" } 
    }
  }
}

Essentially it seems I can use a query query anywhere where I can use any of the other queries, and it can wrap any other query.

What is this query query and is there any documentation about it?

Hi,

There is indeed a query query, which only exists for backward compatibility reasons. There used to be a query filter in version 1.x (https://www.elastic.co/guide/en/elasticsearch/reference/1.7/query-dsl-query-filter.html). In 2.x we merged queries and filters, but to keep existing queries compatible, we had to keep a query query which just returns the inner query. This quey query is removed in version 5.0.

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.