# What does "adjust\_pure\_negative" flag do?

**URL:** <https://discuss.elastic.co/t/what-does-adjust-pure-negative-flag-do/92348>\
**Category:** Elasticsearch\
**Created:** [July 8, 2017, 2:17am UTC](https://discuss.elastic.co/t/what-does-adjust-pure-negative-flag-do/92348 "2017-07-08T02:17:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nickolay\_Kondratyev](https://avatars.discourse-cdn.com/v4/letter/n/edb3f5/32.png) [@Nickolay\_Kondratyev](https://discuss.elastic.co/u/Nickolay_Kondratyev)\
**Post date:** [July 8, 2017, 2:17am UTC](https://discuss.elastic.co/t/what-does-adjust-pure-negative-flag-do/92348/1 "2017-07-08T02:17:46Z")

</div>

I am using Boolean query builder which when looking at the query being run has 'adjust\_pure\_negative' flag set to true when doing google searching the documentation for this flag doesn't come up. What exactly does 'adjust\_pure\_negative' signify?

Example using (ES 5.0 api):

```
    final BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
    boolQueryBuilder.must(QueryBuilders.termQuery("some-term", "some-val"));
    System.out.println(boolQueryBuilder.buildAsBytes().utf8ToString());

```

Output:

```
    {"bool":{"must":[{"term":{"some-term":{"value":"some-val","boost":1.0}}}],"disable_coord":false,"adjust_pure_negative":true,"boost":1.0}}
```

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [July 8, 2017, 11:59am UTC](https://discuss.elastic.co/t/what-does-adjust-pure-negative-flag-do/92348/2 "2017-07-08T11:59:45Z")

</div>

You can ignore it. It "does the right thing" when calling Lucene when all clauses are "must\_not" clauses (no shoulds or musts). Ordinarily Lucene expects some positive clauses so would return nothing. Elasticsearch adjusts for this case by adding a must match\_all type clause which means Lucene would then provide results, filtered by the must\_nots.  
True is the default setting and anything else seems non-sensical.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 5, 2017, 12:00pm UTC](https://discuss.elastic.co/t/what-does-adjust-pure-negative-flag-do/92348/3 "2017-08-05T12:00:21Z")

</div>

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