mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 18:03:32 -04:00
This PR deprecates the use of NotQueryBuilder like we did with And- and OrQueryBuilder before. BooleanQueryBuilder is now the only way to combine several filters together, so all uses of the not filter can be replaced with a must_not clause.
17 lines
375 B
Text
17 lines
375 B
Text
[[java-query-dsl-not-query]]
|
|
==== Not Query
|
|
|
|
deprecated[2.1.0, Use `boolQuery()` with added `mustNot()` clause instead]
|
|
|
|
See {ref}/query-dsl-not-query.html[Not Query]
|
|
|
|
|
|
[source,java]
|
|
--------------------------------------------------
|
|
QueryBuilder qb = notQuery(
|
|
rangeQuery("price").from("1").to("2") <1>
|
|
);
|
|
--------------------------------------------------
|
|
<1> query
|
|
|
|
|