Query for absence of field


(aaron) #1

I would like to index some document with a field, isActive = true, and then
later query for documents that have this field = false or that do not have
the field at all. Can I query for documents that are absent values for a
given field?


(David Pilato) #2

Are you looking for the missing filter ?

http://www.elasticsearch.org/guide/reference/query-dsl/missing-filter.html

HTH
David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 24 avr. 2012 à 23:15, aaron atdixon@gmail.com a écrit :

I would like to index some document with a field, isActive = true, and then later query for documents that have this field = false or that do not have the field at all. Can I query for documents that are absent values for a given field?


(aaron) #3

Thank you!

On Tuesday, April 24, 2012 4:36:57 PM UTC-5, David Pilato wrote:

Are you looking for the missing filter ?

http://www.elasticsearch.org/guide/reference/query-dsl/missing-filter.html

HTH
David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 24 avr. 2012 à 23:15, aaron <> a écrit :

I would like to index some document with a field, isActive = true, and
then later query for documents that have this field = false or that do not
have the field at all. Can I query for documents that are absent values for
a given field?


(system) #4