Testing for an Empty String With the Following


(Paul-4) #1

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


(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 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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/cbf00b67-b354-4087-a937-450055fce661%40googlegroups.comhttps://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.

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


(system) #3