# ElasticSearch (6.5) Java high level rest client - must(QueryBuilders.rangeQuery) and mustNot(QueryBuilders.existsQuery) cmbination not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-6-5-java-high-level-rest-client-must-querybuilders-rangequery-and-mustnot-querybuilders-existsquery-cmbination-not-working/174641>\
**Category:** Elasticsearch\
**Created:** [March 30, 2019, 2:22pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-java-high-level-rest-client-must-querybuilders-rangequery-and-mustnot-querybuilders-existsquery-cmbination-not-working/174641 "2019-03-30T14:22:21Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 30, 2019, 6:14pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-java-high-level-rest-client-must-querybuilders-rangequery-and-mustnot-querybuilders-existsquery-cmbination-not-working/174641/6 "2019-03-30T18:14:11Z")

</div>

Please read again: [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21)

> A typical script like this one can be copied and pasted in Kibana Dev Console by any reader. It will definitely help to play with your example and provide a fix for your script.  
> If you don't provide it, there is a chance that nobody can help.

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-6-5-java-high-level-rest-client-must-querybuilders-rangequery-and-mustnot-querybuilders-existsquery-cmbination-not-working/174641)._
