# Multi Level nested search by using NEST API

**URL:** <https://discuss.elastic.co/t/multi-level-nested-search-by-using-nest-api/22272>\
**Category:** Elasticsearch\
**Created:** [February 19, 2015, 7:06pm UTC](https://discuss.elastic.co/t/multi-level-nested-search-by-using-nest-api/22272 "2015-02-19T19:06:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xinli\_Shang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@Xinli\_Shang](https://discuss.elastic.co/u/Xinli_Shang)\
**Post date:** [February 19, 2015, 7:06pm UTC](https://discuss.elastic.co/t/multi-level-nested-search-by-using-nest-api/22272/1 "2015-02-19T19:06:52Z")

</div>

I am having trouble to make multi level nested query by using NEST API.  
Here is my mapping.

{  
"log": {  
"mappings":{  
"LogEvent": {  
"properties":{

"@timestamp":{"type":"date","store":true,"format":"yyyy-MM-dd'T'HH:mm:ss"},  
"records":  
{"type":"nested","properties":{

"eventtype" : {"type":"string","store":true},

"detail":{"type":"string","store":true},

"others":{

"type":"nested","properties":{

"ScrubbedContent":{"type":"string","store":true},

"RawContent":{"type":"string","store":true}

}

}  
} } }  
}  
}

And here is the query that works

{  
"from": 0,  
"size": 1,  
"query": {  
"filtered": {  
"filter": {  
"and": {  
"filters": [  
{  
"range": {  
"@timestamp": {  
"gte": "2015-02-12T02:37:32",  
"lte": "2015-02-19T02:37:32"  
}  
}  
},  
{  
"nested": {  
"filter": {  
"terms": {  
"records.eventtype": "myeventtype"  
}  
},  
"path": "records"  
}  
}  
]  
}  
}  
}  
}  
}

But if I change "path": "records" to "path": "records._others_", no result  
returned. I am pretty sure I should have results for it.

Any thought why?

--  
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/CAHsnNRjY8dLpzd260Pg6rkoAHVKvZWwC9OZS%3DUinpaoXTJU6Dg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHsnNRjY8dLpzd260Pg6rkoAHVKvZWwC9OZS%3DUinpaoXTJU6Dg%40mail.gmail.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:31am UTC](https://discuss.elastic.co/t/multi-level-nested-search-by-using-nest-api/22272/2 "2017-07-06T00:31:28Z")

</div>


