# How to distinguish ”true“ from true（they are all Booleans）

**URL:** <https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676>\
**Category:** Elasticsearch\
**Created:** [October 26, 2021, 10:18am UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676 "2021-10-26T10:18:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [October 26, 2021, 10:18am UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/1 "2021-10-26T10:18:04Z")

</div>

v: 7.10.2  
There are some docs in index such as {"tag":"true"} {"tag":true}，the tag is boolean type ......  
i want to find out docs with tag==”true“，i tried script query use instanceof but it didn't work

---

<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:** [October 26, 2021, 12:20pm UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/2 "2021-10-26T12:20:51Z")

</div>

Not sure you can. But what is the problem you want to solve by doing this?

> [@casterQ](#):
>
> v: 7.10.2

Please upgrade. 7.15.1 has been released.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [October 26, 2021, 12:30pm UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/3 "2021-10-26T12:30:38Z")

</div>

Thank you for your reply！  
I just want to find out how many docs has "true" （not true）in index and then change them to true，the update pipeline is ready，but i can't judge if all ”true“ has been changed to true。  
By the way，a coordinating node has off-heap OOM and been killed by kernel:OOM killer, Do you have any suggestions？thanks a lot。

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [October 28, 2021, 1:25am UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/4 "2021-10-28T01:25:07Z")

</div>

Are you there？

---

<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:** [October 28, 2021, 5:10am UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/5 "2021-10-28T05:10:37Z")

</div>

But why do you need this? Is there any problem of having `true` or `"true"` in the `_source`?

As I said, I don't know how you could do this.

For the other question, please open a new discussion as it's unrelated.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 28, 2021, 5:16am UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/6 "2021-10-28T05:16:33Z")

</div>

What is important is the mapping of the actual field Do you have it mapped as a `boolean` or as a `text` or `keyword`.

The `_source` is really irrelevant

---

<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:** [November 25, 2021, 5:17am UTC](https://discuss.elastic.co/t/how-to-distinguish-true-from-true-they-are-all-booleans/287676/7 "2021-11-25T05:17:03Z")

</div>

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