Non-analyzed Field Must Be Null

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

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

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