WARNING: Version 2.0 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Not Query
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Not Query
editA query that filters out matched documents using a query. For example:
{ "bool" : { "must" : { "term" : { "name.first" : "shay" } }, "filter" : { "not" : { "range" : { "postDate" : { "from" : "2010-03-01", "to" : "2010-04-01" } } } } } }
Or, in a longer form with a filter
element:
{ "bool" : { "must" : { "term" : { "name.first" : "shay" } }, "filter" : { "not" : { "filter" : { "range" : { "postDate" : { "from" : "2010-03-01", "to" : "2010-04-01" } } } } } } }
Was this helpful?
Thank you for your feedback.