# Testing for an Empty String

**URL:** <https://discuss.elastic.co/t/testing-for-an-empty-string/17089>\
**Category:** Elasticsearch\
**Created:** [April 18, 2014, 8:24pm UTC](https://discuss.elastic.co/t/testing-for-an-empty-string/17089 "2014-04-18T20:24:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_4](https://avatars.discourse-cdn.com/v4/letter/p/73ab20/32.png) [@Paul\_4](https://discuss.elastic.co/u/Paul_4)\
**Post date:** [April 18, 2014, 8:24pm UTC](https://discuss.elastic.co/t/testing-for-an-empty-string/17089/1 "2014-04-18T20:24:22Z")

</div>

Hi,

Thanks for everyone's patience while I learn the elasticsearch query DSL.  
I'm trying to get used to its verbosity.

How would I do a query like this, again in SQL parlance: select col1 from  
mysource where col2 = ""?

--  
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/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 19, 2014, 2:35pm UTC](https://discuss.elastic.co/t/testing-for-an-empty-string/17089/2 "2014-04-19T14:35:48Z")

</div>

Hi Paul

You need to use a "missing" filter:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

You can read the section of the guide about "Dealing with null values"  
here:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

On 18 April 2014 22:24, Paul [paulj3000@gmail.com](mailto:paulj3000@gmail.com) wrote:

> Hi,
> 
> Thanks for everyone's patience while I learn the elasticsearch query DSL.  
> I'm trying to get used to its verbosity.
> 
> How would I do a query like this, again in SQL parlance: select col1 from  
> mysource where col2 = ""?
> 
> --  
> 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/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%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/CAPt3XKQV%3DtWKXRNEOC44a-v%3DmEzHUhyu1BQ2WfE4%2BcsRDQ88Mw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKQV%3DtWKXRNEOC44a-v%3DmEzHUhyu1BQ2WfE4%2BcsRDQ88Mw%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:34am UTC](https://discuss.elastic.co/t/testing-for-an-empty-string/17089/3 "2017-07-06T01:34:50Z")

</div>


