# Possible JVM issue with "missing" filter

**URL:** https://discuss.elastic.co/t/possible-jvm-issue-with-missing-filter/19695
**Category:** Elasticsearch
**Created:** [September 9, 2014, 9:18pm UTC](https://discuss.elastic.co/t/possible-jvm-issue-with-missing-filter/19695 "2014-09-09T21:18:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lesbarstow](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lesbarstow](https://discuss.elastic.co/u/lesbarstow)
#### Post date: [September 9, 2014, 9:18pm UTC](https://discuss.elastic.co/t/possible-jvm-issue-with-missing-filter/19695/1 "2014-09-09T21:18:40Z")

</div>

(Apologies in advance for including sample code - having issues with gist  
at the second...)

When running some tests against ElasticSearch 1.3.2, we noticed what  
appears to be a problem with the "missing" filter. This problem manifests  
with JVM 1.7.0\_60 (recommended in the ES documentation), but disappears  
under JVM 1.7.0\_67.

If we create a simple template with a single property designating a string  
field:

{  
"template": "empty\_ex\*",  
"settings": { "number\_of\_shards": 1 },

```
"mappings": {
    "empty_example": {
       "_source": { "enabled" : true },
        "properties": {
            "testField": { "type": "string" }
        }
    }
}

```

}

And then enter a simple document:

curl -XPUT [http://localhost:9200/empty\_ex1/empty\_example/1](http://localhost:9200/empty_ex1/empty_example/1) -d  
'{"testField":""}'

Then the following simple filter fails to retrieve the document in JVM  
1.7.0\_60, but retrieves the document properly in 1.7.0\_67.

{  
"filter": {  
"missing": {  
"field": "testField"  
}  
}  
}

Simply switching out the JVM changes the query results on existing indexes,  
so this appears to be a query-side issue only. Adding "null\_value": true  
does not return any hits under JVM \_60 either...

Can someone confirm this?

--  
Les Barstow, Senior Software Engineer  
Return Path, Inc.  
The Global Leader In Email Intelligence

--  
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/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%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: [September 9, 2014, 10:43pm UTC](https://discuss.elastic.co/t/possible-jvm-issue-with-missing-filter/19695/2 "2014-09-09T22:43:40Z")

</div>

I can not reproduce this on Mac OS X.

The behavior of "missing"/"exists" filter for empty fields has slightly  
changed, see [Speed up `exists` and `missing` filters on high-cardinality fields · Issue #5659 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/5659)

Jörg

On Tue, Sep 9, 2014 at 11:18 PM, Les Barstow [les.barstow@returnpath.com](mailto:les.barstow@returnpath.com)  
wrote:

> (Apologies in advance for including sample code - having issues with gist  
> at the second...)
> 
> When running some tests against Elasticsearch 1.3.2, we noticed what  
> appears to be a problem with the "missing" filter. This problem manifests  
> with JVM 1.7.0\_60 (recommended in the ES documentation), but disappears  
> under JVM 1.7.0\_67.
> 
> If we create a simple template with a single property designating a string  
> field:
> 
> {  
> "template": "empty\_ex\*",  
> "settings": { "number\_of\_shards": 1 },
> 
> ```
> "mappings": {
> "empty_example": {
> "_source": { "enabled" : true },
> "properties": {
> "testField": { "type": "string" }
> }
> }
> }
> 
> ```
> 
> }
> 
> And then enter a simple document:
> 
> curl -XPUT [http://localhost:9200/empty\_ex1/empty\_example/1](http://localhost:9200/empty_ex1/empty_example/1) -d  
> '{"testField":""}'
> 
> Then the following simple filter fails to retrieve the document in JVM  
> 1.7.0\_60, but retrieves the document properly in 1.7.0\_67.
> 
> {  
> "filter": {  
> "missing": {  
> "field": "testField"  
> }  
> }  
> }
> 
> Simply switching out the JVM changes the query results on existing  
> indexes, so this appears to be a query-side issue only. Adding  
> "null\_value": true does not return any hits under JVM \_60 either...
> 
> Can someone confirm this?
> 
> --  
> Les Barstow, Senior Software Engineer  
> Return Path, Inc.  
> The Global Leader In Email Intelligence
> 
> --  
> 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/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%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/CAKdsXoFKixVmFBJ6%3DGqH6oxLOnnDBZsXRGd%3D\_eM3VBHw2XMLjA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFKixVmFBJ6%3DGqH6oxLOnnDBZsXRGd%3D_eM3VBHw2XMLjA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![lesbarstow](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lesbarstow](https://discuss.elastic.co/u/lesbarstow)
#### Post date: [September 9, 2014, 11:53pm UTC](https://discuss.elastic.co/t/possible-jvm-issue-with-missing-filter/19695/3 "2014-09-09T23:53:21Z")

</div>

Thanks. [Search result changed since 1.24 (current 1.3.2) · Issue #7348 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/7348) is a  
recently opened bug that addresses my problem. Don't know why 1.7.0\_67  
"fixes" it on my Linux box (and others who have replicated it...)

--  
Les

On Tue, Sep 9, 2014 at 4:43 PM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<[joergprante@gmail.com](mailto:joergprante@gmail.com)

> wrote:

> I can not reproduce this on Mac OS X.
> 
> The behavior of "missing"/"exists" filter for empty fields has slightly  
> changed, see [Speed up `exists` and `missing` filters on high-cardinality fields · Issue #5659 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/5659)
> 
> Jörg
> 
> On Tue, Sep 9, 2014 at 11:18 PM, Les Barstow [les.barstow@returnpath.com](mailto:les.barstow@returnpath.com)  
> wrote:
> 
> > (Apologies in advance for including sample code - having issues with gist  
> > at the second...)
> > 
> > When running some tests against Elasticsearch 1.3.2, we noticed what  
> > appears to be a problem with the "missing" filter. This problem manifests  
> > with JVM 1.7.0\_60 (recommended in the ES documentation), but disappears  
> > under JVM 1.7.0\_67.
> > 
> > If we create a simple template with a single property designating a  
> > string field:
> > 
> > {  
> > "template": "empty\_ex\*",  
> > "settings": { "number\_of\_shards": 1 },
> > 
> > ```
> > "mappings": {
> > "empty_example": {
> > "_source": { "enabled" : true },
> > "properties": {
> > "testField": { "type": "string" }
> > }
> > }
> > }
> > 
> > ```
> > 
> > }
> > 
> > And then enter a simple document:
> > 
> > curl -XPUT [http://localhost:9200/empty\_ex1/empty\_example/1](http://localhost:9200/empty_ex1/empty_example/1) -d  
> > '{"testField":""}'
> > 
> > Then the following simple filter fails to retrieve the document in JVM  
> > 1.7.0\_60, but retrieves the document properly in 1.7.0\_67.
> > 
> > {  
> > "filter": {  
> > "missing": {  
> > "field": "testField"  
> > }  
> > }  
> > }
> > 
> > Simply switching out the JVM changes the query results on existing  
> > indexes, so this appears to be a query-side issue only. Adding  
> > "null\_value": true does not return any hits under JVM \_60 either...
> > 
> > Can someone confirm this?
> > 
> > --  
> > Les Barstow, Senior Software Engineer  
> > Return Path, Inc.  
> > The Global Leader In Email Intelligence
> > 
> > --  
> > 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/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5a68b02e-fc07-477c-9999-a1e26e310802%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/CAKdsXoFKixVmFBJ6%3DGqH6oxLOnnDBZsXRGd%3D\_eM3VBHw2XMLjA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFKixVmFBJ6%3DGqH6oxLOnnDBZsXRGd%3D_eM3VBHw2XMLjA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFKixVmFBJ6%3DGqH6oxLOnnDBZsXRGd%3D\_eM3VBHw2XMLjA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFKixVmFBJ6%3DGqH6oxLOnnDBZsXRGd%3D_eM3VBHw2XMLjA%40mail.gmail.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/CAOppbCXffaNxNh91tPMzvEqmyCe563\_LGAhLW4K%2BrarCOmnCvg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAOppbCXffaNxNh91tPMzvEqmyCe563_LGAhLW4K%2BrarCOmnCvg%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, 1:03am UTC](https://discuss.elastic.co/t/possible-jvm-issue-with-missing-filter/19695/4 "2017-07-06T01:03:32Z")

</div>


