# Testing for an Empty String With the Following

**URL:** <https://discuss.elastic.co/t/testing-for-an-empty-string-with-the-following/17091>\
**Category:** Elasticsearch\
**Created:** [April 18, 2014, 9:58pm UTC](https://discuss.elastic.co/t/testing-for-an-empty-string-with-the-following/17091 "2014-04-18T21:58:29Z")\
**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, 9:58pm UTC](https://discuss.elastic.co/t/testing-for-an-empty-string-with-the-following/17091/1 "2014-04-18T21:58:29Z")

</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 = "" and col3 in ["", "one", "two"] and col4 = "foo"

--  
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/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 21, 2014, 12:58pm UTC](https://discuss.elastic.co/t/testing-for-an-empty-string-with-the-following/17091/2 "2014-04-21T12:58:22Z")

</div>

Hey,

not sure if you really want to test for an empty string, or maybe for an  
empty field? There is a missing filter which you could potentially use for  
that, see

> **[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.

--Alex

On Fri, Apr 18, 2014 at 11:58 PM, 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 = "" and col3 in ["", "one", "two"] and col4 = "foo"
> 
> --  
> 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/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%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/CAGCwEM8\_dVB3-16aK8rHv3cAF%2BNYBzCiK6RxVdzmUqQPLjFDeQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8_dVB3-16aK8rHv3cAF%2BNYBzCiK6RxVdzmUqQPLjFDeQ%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-with-the-following/17091/3 "2017-07-06T01:34:33Z")

</div>


