# Missing and exists filters don't work in ES 1.4 as they do in ES 1.1.1

**URL:** <https://discuss.elastic.co/t/missing-and-exists-filters-dont-work-in-es-1-4-as-they-do-in-es-1-1-1/21210>\
**Category:** Elasticsearch\
**Created:** [December 11, 2014, 12:26pm UTC](https://discuss.elastic.co/t/missing-and-exists-filters-dont-work-in-es-1-4-as-they-do-in-es-1-1-1/21210 "2014-12-11T12:26:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arshad\_Ali](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@arshad\_Ali](https://discuss.elastic.co/u/arshad_Ali)\
**Post date:** [December 11, 2014, 12:26pm UTC](https://discuss.elastic.co/t/missing-and-exists-filters-dont-work-in-es-1-4-as-they-do-in-es-1-1-1/21210/1 "2014-12-11T12:26:56Z")

</div>

Dear folks,

I have discovered that missing filter doesn't work in ES 1.4 as it does in  
1.1.1. I have two instances running and have run the following query on  
both but in 1.4 everytime i get nothing and 1.1.1 does exactly what i want  
it to do. could you please look into it.

GET myindex/\_search?pretty  
{"query": {"filtered": {  
"query": {"match\_all": {}},  
"filter": {"missing": {  
"field": "abstract"  
}}  
}}}

Similarly when i run the following to get records having values in  
"abstract" field only, it gives me everything including those which have  
null values. when i run this query in 1.1.1, it does it perfectly allright.

{"query": {"filtered": {  
"query": {"match\_all": {}},  
"filter": {"exists": {  
"field": "abstract"  
}}  
}}}

Please let me know if this is a bug or if I am missing anything here or not  
aware of the changes in 1.4

many thanks

Arshad

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/11d61a6b-f20e-4513-94c1-4ad8e2990a50%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/11d61a6b-f20e-4513-94c1-4ad8e2990a50%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 11, 2014, 11:57pm UTC](https://discuss.elastic.co/t/missing-and-exists-filters-dont-work-in-es-1-4-as-they-do-in-es-1-1-1/21210/2 "2014-12-11T23:57:26Z")

</div>

There have been a change in order for better performance. Empty or null  
values are not the same semantics as missing field and this unfortunately  
changed without a notice. There is a workaround using range filter to get  
the old behavior.

Jörg  
Am 11.12.2014 13:26 schrieb "arshad Ali" [holberry@gmail.com](mailto:holberry@gmail.com):

> Dear folks,
> 
> I have discovered that missing filter doesn't work in ES 1.4 as it does in  
> 1.1.1. I have two instances running and have run the following query on  
> both but in 1.4 everytime i get nothing and 1.1.1 does exactly what i want  
> it to do. could you please look into it.
> 
> GET myindex/\_search?pretty  
> {"query": {"filtered": {  
> "query": {"match\_all": {}},  
> "filter": {"missing": {  
> "field": "abstract"  
> }}  
> }}}
> 
> Similarly when i run the following to get records having values in  
> "abstract" field only, it gives me everything including those which have  
> null values. when i run this query in 1.1.1, it does it perfectly allright.
> 
> {"query": {"filtered": {  
> "query": {"match\_all": {}},  
> "filter": {"exists": {  
> "field": "abstract"  
> }}  
> }}}
> 
> Please let me know if this is a bug or if I am missing anything here or  
> not aware of the changes in 1.4
> 
> many thanks
> 
> Arshad
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/11d61a6b-f20e-4513-94c1-4ad8e2990a50%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/11d61a6b-f20e-4513-94c1-4ad8e2990a50%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/11d61a6b-f20e-4513-94c1-4ad8e2990a50%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/11d61a6b-f20e-4513-94c1-4ad8e2990a50%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH7b87Eok4TKDjNmwUBmqOebsk4xMWEPW8%3D51cGq3%3DV9A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH7b87Eok4TKDjNmwUBmqOebsk4xMWEPW8%3D51cGq3%3DV9A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:44am UTC](https://discuss.elastic.co/t/missing-and-exists-filters-dont-work-in-es-1-4-as-they-do-in-es-1-1-1/21210/3 "2017-07-06T00:44:02Z")

</div>


