Non-analyzed Field Must Be Null


(timscott) #1

How can I query to return only documents with a certain non-analyzed field equal null? I tried this, but it didn't work:

{"wildcard":{"MyField":{"value":null}}}


(timscott) #2

This seems to work. Is there a better (more correct) way?

{"field":{"MyField":{"query":"-*"}}}

How can I query to return only documents with a certain non-analyzed field equal null? I tried this, but it didn't work:

{"wildcard":{"MyField":{"value":null}}}


(Clinton Gormley) #3

On Wed, 2011-01-05 at 11:30 -0800, timscott wrote:

This seems to work. Is there a better (more correct) way?

{"field":{"MyField":{"query":"-*"}}}

Look at

http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/missing_filter/

clint


(system) #4