Testing for an Empty String With the Following

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Testing for an Empty String With the Following

Paul-4
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Testing for an Empty String With the Following

Alexander Reelsen-2
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 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-missing-filter.html#query-dsl-missing-filter


--Alex


On Fri, Apr 18, 2014 at 11:58 PM, Paul <[hidden email]> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.com.
For more options, visit 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8_dVB3-16aK8rHv3cAF%2BNYBzCiK6RxVdzmUqQPLjFDeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.