Hi Ivan, Thanks for reply. Please find below the mapping for the giving field.
{ "giving": { "properties": { "assignee": { "type": "string", "fields": { "assignee": { "type": "string", "index": "analyzed", "store": "yes", "include_in_all": false }, "untouched": { "type": "string", "index": "not_analyzed", "store": "yes" } } } } } } Thanks, Ayush On Wednesday, September 3, 2014 5:17:29 PM UTC-4, Ivan Brusic wrote: > > Is giving.assignee a sub-object or a nested document? Can you provide your > mapping? Use the mapping API for exact results ( > http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html > ) > > Perhaps enabling explain would provide some hints, > > -- > Ivan > > > On Wed, Sep 3, 2014 at 2:07 PM, ElasticRabbit <ayushs...@gmail.com > <javascript:>> wrote: > >> Hi Everyone, >> >> Goal: I want to find all the documents which does not have >> giving.assignee field. >> >> I am executing below query on ES version 1.3.2 involving exists filter >> and boolean filter. >> >> { >> "query": { >> "filtered": { >> "query": { >> "match_all": {} >> }, >> "filter": { >> "bool": { >> "must_not": [ >> { >> "exists": { >> "field": "giving.assignee" >> } >> } >> ] >> } >> } >> } >> }, >> "size": 2000 >> } >> >> While executing this query it gives me those documents also where >> giving.assignee field exists or has some value in it. >> We have around 2 million documents and it's returning almost close to 2 >> million documents. >> >> I have also tried using the missing filter but no luck. >> >> { >> "query": { >> "filtered": { >> "query": { >> "match_all": {} >> }, >> "filter": { >> "bool": { >> "must": [ >> { >> "missing": { >> "field": "giving.assignee" >> } >> } >> ] >> } >> } >> } >> }, >> "size": 20000 >> } >> >> Same result as of the above query. >> If someone can point me what am I doing wrong here or if further >> information is needed please let me know. >> Looking forward for help. >> >> Thanks, >> Ayush Sangani >> >> >> -- >> 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 elasticsearc...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elasticsearch/89f2193a-5f11-447f-901c-29790318ddbf%40googlegroups.com >> >> <https://groups.google.com/d/msgid/elasticsearch/89f2193a-5f11-447f-901c-29790318ddbf%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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/465afb27-b018-4aa7-83fc-69e5cd740409%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.