# How to fetch the data from the nested structured data ? in elastic search

**URL:** <https://discuss.elastic.co/t/how-to-fetch-the-data-from-the-nested-structured-data-in-elastic-search/48155>\
**Category:** Elasticsearch\
**Created:** [April 22, 2016, 9:14am UTC](https://discuss.elastic.co/t/how-to-fetch-the-data-from-the-nested-structured-data-in-elastic-search/48155 "2016-04-22T09:14:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sukesh/32/10890_2.png) [@sukesh](https://discuss.elastic.co/u/sukesh)\
**Post date:** [April 22, 2016, 9:14am UTC](https://discuss.elastic.co/t/how-to-fetch-the-data-from-the-nested-structured-data-in-elastic-search/48155/1 "2016-04-22T09:14:02Z")

</div>

{  
"group" : "fans",  
"user" : [  
{  
"first" : "John",  
"last" : "Smith"  
},  
{  
"first" : "Alice",  
"last" : "White"  
},  
]  
}  
i need to fetch the user's firstname only

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [April 22, 2016, 4:11pm UTC](https://discuss.elastic.co/t/how-to-fetch-the-data-from-the-nested-structured-data-in-elastic-search/48155/2 "2016-04-22T16:11:03Z")

</div>

You can use the `fields` parameter to limit the fields in your output. So if e.g. you model the user as nested objects and run a `nested_query` you can then filter with `"fields": ["user.first"]` and the output will only contain that field.

---

<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:56pm UTC](https://discuss.elastic.co/t/how-to-fetch-the-data-from-the-nested-structured-data-in-elastic-search/48155/3 "2017-07-05T22:56:57Z")

</div>


