# Elasticsearch Nested Filters being inclusive vs. exclusive

**URL:** <https://discuss.elastic.co/t/elasticsearch-nested-filters-being-inclusive-vs-exclusive/20510>\
**Category:** Elasticsearch\
**Created:** [October 31, 2014, 2:30am UTC](https://discuss.elastic.co/t/elasticsearch-nested-filters-being-inclusive-vs-exclusive/20510 "2014-10-31T02:30:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![d2kagw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d2kagw/32/1139_2.png) [@d2kagw](https://discuss.elastic.co/u/d2kagw)\
**Post date:** [October 31, 2014, 2:30am UTC](https://discuss.elastic.co/t/elasticsearch-nested-filters-being-inclusive-vs-exclusive/20510/1 "2014-10-31T02:30:39Z")

</div>

I have an object mapping that uses nested objects (props in our example) in  
a tag-like fashion. Each tag can belong to a client/user and when we want  
to allow our users to generate query\_string style searches against the  
props.name.

Issue is that when we run our query if an object has multiple props and if  
one of the many props match the filter when others don't the object is  
returned, when we want the opposite - if one returns false don't return vs.  
if one returns true return.

I have posted a comprehensive example here:

> <https://gist.github.com/d2kagw/1c9d4ef486b7a2450d95>

Thanks in advance.

--  
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/ab40c40b-39f9-4ec9-8c29-51de9c00558f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ab40c40b-39f9-4ec9-8c29-51de9c00558f%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:52am UTC](https://discuss.elastic.co/t/elasticsearch-nested-filters-being-inclusive-vs-exclusive/20510/2 "2017-07-06T00:52:54Z")

</div>


