# Multi-Nested Filter Query testing

**URL:** <https://discuss.elastic.co/t/multi-nested-filter-query-testing/51729>\
**Category:** Elasticsearch\
**Created:** [June 2, 2016, 6:05pm UTC](https://discuss.elastic.co/t/multi-nested-filter-query-testing/51729 "2016-06-02T18:05:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![teebu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teebu/32/10119_2.png) [@teebu](https://discuss.elastic.co/u/teebu)\
**Post date:** [June 2, 2016, 6:05pm UTC](https://discuss.elastic.co/t/multi-nested-filter-query-testing/51729/1 "2016-06-02T18:05:09Z")

</div>

what does "Multi level nesting is automatically supported, and detected, resulting in an inner nested query to automatically match the relevant nesting level (and not root) if it exists within another nested query." mean? Is there an example?

i have a multi-nested document, mydocument.nest1.nest2, when i set path: "mydocument" i can't just say: term: mydocument.nest1.nest2. it requires the path to be mydocument.nest1 to work.

Also, is it possible to execute a single filter on multi-nested fields?

```
 "filter": {
                                         "bool": {
                                             "must": [
                                                 { "nested": {
                                                     "path": "attributes",
                                                     "filter": {
                                                          "bool": {
                                                             "must": [{
                                                                 "terms": { 
                                                                     "attributes.attributesForType.attributeID": ["test"]
                                                                 },
                                                                 "term": {
                                                                     "attributes.attributeType": "test"
                                                                 }
                                                             }]
                                                          }
                                                     }
                                                 }
                                             }]
                                         }
                                     }
```

---

<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 5, 2017, 10:46pm UTC](https://discuss.elastic.co/t/multi-nested-filter-query-testing/51729/2 "2017-07-05T22:46:46Z")

</div>


