# How to find null\_value in query\_string like we can in missing filter

**URL:** <https://discuss.elastic.co/t/how-to-find-null-value-in-query-string-like-we-can-in-missing-filter/19055>\
**Category:** Elasticsearch\
**Created:** [August 3, 2014, 5:18pm UTC](https://discuss.elastic.co/t/how-to-find-null-value-in-query-string-like-we-can-in-missing-filter/19055 "2014-08-03T17:18:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [August 3, 2014, 5:18pm UTC](https://discuss.elastic.co/t/how-to-find-null-value-in-query-string-like-we-can-in-missing-filter/19055/1 "2014-08-03T17:18:05Z")

</div>

I'm using elasticsearch v0.90.5

With a missing filter, we can track missing fields:  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-missing-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-missing-filter.html)  
and make sure that a null\_value also counts as missing.

How can we do the same in a query\_string?  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#\_field\_names](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_field_names)  
Based on my test so far, the non-existent field counts as missing but the  
null\_value field counts as present.

How should I write my query?

--  
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/c51f170b-3775-4b8a-909c-8d00a9095c69%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c51f170b-3775-4b8a-909c-8d00a9095c69%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [August 13, 2014, 7:01pm UTC](https://discuss.elastic.co/t/how-to-find-null-value-in-query-string-like-we-can-in-missing-filter/19055/2 "2014-08-13T19:01:55Z")

</div>

Can anyone help with this comparison between missing fields in filter vs.  
query?

On Sunday, August 3, 2014 12:18:05 PM UTC-5, pulkitsinghal wrote:

> I'm using elasticsearch v0.90.5
> 
> With a missing filter, we can track missing fields:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-missing-filter.html)  
> and make sure that a null\_value also counts as missing.
> 
> How can we do the same in a query\_string?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_field_names)  
> Based on my test so far, the non-existent field counts as missing but the  
> null\_value field counts as present.
> 
> How should I write my query?

--  
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/67d6303a-2694-4097-bf6d-c8ffcaaa9a58%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/67d6303a-2694-4097-bf6d-c8ffcaaa9a58%40googlegroups.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:08am UTC](https://discuss.elastic.co/t/how-to-find-null-value-in-query-string-like-we-can-in-missing-filter/19055/3 "2017-07-06T01:08:50Z")

</div>


