Testing for an Empty String


(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 = ""?

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


(Clinton Gormley) #2

Hi Paul

You need to use a "missing" filter:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-missing-filter.html#query-dsl-missing-filter

You can read the section of the guide about "Dealing with null values"
here:
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_dealing_with_null_values.html#_dealing_with_null_values

clint

On 18 April 2014 22:24, 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 = ""?

--
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/6b614d6f-cb0f-4bad-9a64-f787bd0deb29%40googlegroups.comhttps://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.

--
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/CAPt3XKQV%3DtWKXRNEOC44a-v%3DmEzHUhyu1BQ2WfE4%2BcsRDQ88Mw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3