# Multilevel Nested Query with different nested paths

**URL:** <https://discuss.elastic.co/t/multilevel-nested-query-with-different-nested-paths/151772>\
**Category:** Elasticsearch\
**Created:** [October 10, 2018, 7:29am UTC](https://discuss.elastic.co/t/multilevel-nested-query-with-different-nested-paths/151772 "2018-10-10T07:29:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elastic2](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@elastic2](https://discuss.elastic.co/u/elastic2)\
**Post date:** [October 10, 2018, 7:29am UTC](https://discuss.elastic.co/t/multilevel-nested-query-with-different-nested-paths/151772/1 "2018-10-10T07:29:10Z")

</div>

Hello,

This question is in response to an earlier [question](https://discuss.elastic.co/t/querying-a-multiple-level-nested-object/56889/5?u=elastic2) thats closed now. @ [cbuescher](https://discuss.elastic.co/u/cbuescher)

My query is a little similar, but i need to search on two different nested paths.

Query:

```
POST /nested_test/t/_search
{
	"query": {
		"nested": {
			"path": "categories",
			"query": {
				"nested": {
					"path": "categories.list",
					"query": {
						"nested": {
							"path": "categories.list.persons.details",
							"query": {
								"bool": {
									"must": [
										{
											"match": {
												"categories.list.persons.details.person_id": 1
											}
										},
										{
											"match": {
												"categories.list.url_site": "www.bla.org"
											}
										}
									]
								}
							}
						}
					}
				}
			}
		}
	}
}

```

note that i need to match for persion\_id and url\_site.  
But this query does not give me any hits.  
I have searched through a lot, but all multi-level nested query examples i have come accross, only query on fields on same path and not on different paths as my query is.  
Thanks.

---

<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:** [November 7, 2018, 7:34am UTC](https://discuss.elastic.co/t/multilevel-nested-query-with-different-nested-paths/151772/2 "2018-11-07T07:34:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
