# Missing filter for nested field not working

**URL:** <https://discuss.elastic.co/t/missing-filter-for-nested-field-not-working/20640>\
**Category:** Elasticsearch\
**Created:** [November 7, 2014, 7:36pm UTC](https://discuss.elastic.co/t/missing-filter-for-nested-field-not-working/20640 "2014-11-07T19:36:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijay\_Tiwary](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@Vijay\_Tiwary](https://discuss.elastic.co/u/Vijay_Tiwary)\
**Post date:** [November 7, 2014, 7:36pm UTC](https://discuss.elastic.co/t/missing-filter-for-nested-field-not-working/20640/1 "2014-11-07T19:36:59Z")

</div>

I am storing data in the following format:

{  
"doc\_id":"3434567778932";  
"retweeted\_user\_profile":{  
"name": "Henry",  
"gender":"male"  
}  
}  
I have mapped "retweeted\_user\_profile" as nested.

However the following query is not working

curl -XGET '[http://localhost:9200/twitter/\_search](http://localhost:9200/twitter/_search)' -d '{  
"query" : {  
"filtered" : {  
"filter" : {  
"missing" : { "field" : "retweeted\_user\_profile" }  
}  
}  
}  
}'

It is returning me all the results i.e it is also returning documents which  
do not have field "retweeted\_user\_profile".

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8fb7a847-ac38-4bd0-9250-d655faebb51b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8fb7a847-ac38-4bd0-9250-d655faebb51b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:51am UTC](https://discuss.elastic.co/t/missing-filter-for-nested-field-not-working/20640/2 "2017-07-06T00:51:26Z")

</div>


