# What is adjust\_pure\_negative?

**URL:** <https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187>\
**Category:** Elasticsearch\
**Created:** [November 24, 2019, 4:29pm UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187 "2019-11-24T16:29:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [November 24, 2019, 4:29pm UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/1 "2019-11-24T16:29:29Z")

</div>

Can someone please explain what does "adjust\_pure\_negative" do exactly. I couldn't find any documentation regarding on this. I'm using Elasticsearch 6.8.2 version.

---

<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:** [November 24, 2019, 9:27pm UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/2 "2019-11-24T21:27:43Z")

</div>

It’s simply telling Lucene to do a sane thing rather than the default insane thing it does.

If you only have a “must not” clause, Lucene assumes by default you want to match absolutely nothing, and especially not the thing detailed in the not clause. Kind of pointless.

With the adjust parameter elasticsearch takes the query with the not clause and adds a must “match\_all” query so we match everything apart from what’s in the not clause. It’s just more logical that way.

---

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [November 25, 2019, 3:50am UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/3 "2019-11-25T03:50:09Z")

</div>

Thanks @Mark_Harwood. But I can't think about an example which needs to adjust parameter to be false.

---

<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:** [November 25, 2019, 7:56am UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/4 "2019-11-25T07:56:02Z")

</div>

> [@chanakagl](#):
>
> But I can't think about an example which needs to adjust parameter to be false.

I believe that’s why we considered removing the flag and hard coding the default of true. It’s probably a fear of breaking existing systems that relied on it that stopped us removing it.

We certainly don’t advertise the parameter or document it in the Bool docs which is why you’re here I suppose 😄

I opened [this issue](https://github.com/elastic/elasticsearch/issues/49530) to see if we can tidy things up here

---

<div class="post-metadata">

**Author:** ![chanakagl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chanakagl/32/54677_2.png) [@chanakagl](https://discuss.elastic.co/u/chanakagl)\
**Post date:** [November 25, 2019, 10:29am UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/5 "2019-11-25T10:29:33Z")

</div>

Thanks @Mark_Harwood

---

<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:** [November 25, 2019, 10:41am UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/6 "2019-11-25T10:41:00Z")

</div>

Can I ask where you saw this flag appear?  
I've been scanning Kibana code and can't see where it adds it to requests.

---

<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:** [December 23, 2019, 10:41am UTC](https://discuss.elastic.co/t/what-is-adjust-pure-negative/209187/7 "2019-12-23T10:41:09Z")

</div>

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