# Returning a subset of nested objects

**URL:** <https://discuss.elastic.co/t/returning-a-subset-of-nested-objects/26916>\
**Category:** Elasticsearch\
**Created:** [August 5, 2015, 6:35pm UTC](https://discuss.elastic.co/t/returning-a-subset-of-nested-objects/26916 "2015-08-05T18:35:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdh2550](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jdh2550](https://discuss.elastic.co/u/jdh2550)\
**Post date:** [August 5, 2015, 6:35pm UTC](https://discuss.elastic.co/t/returning-a-subset-of-nested-objects/26916/1 "2015-08-05T18:35:00Z")

</div>

I can use the \_source object to return a subset of fields in the root and in the nested objects.

However, is there a way to return a subset of the nested objects rather than all of them?

I have a nested set of nested properties which are name/value pairs and I only want to retrieve the property whose name="foo"...

Thanks,  
John H

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [August 5, 2015, 9:41pm UTC](https://discuss.elastic.co/t/returning-a-subset-of-nested-objects/26916/2 "2015-08-05T21:41:22Z")

</div>

If I have understood you correctly, you can do that with the [Inner Hits](https://www.elastic.co/guide/en/elasticsearch/reference/1.6/search-request-inner-hits.html) functionality.

---

<div class="post-metadata">

**Author:** ![jdh2550](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jdh2550](https://discuss.elastic.co/u/jdh2550)\
**Post date:** [August 7, 2015, 7:09pm UTC](https://discuss.elastic.co/t/returning-a-subset-of-nested-objects/26916/3 "2015-08-07T19:09:12Z")

</div>

Thanks Dan - that was exactly what I needed.

Does anyone know of any way to predict the likelihood of this becoming official (i.e. dropping the experimental tag)? I understand there probably can't be a definitive answer to this - but is there a way to determine a probability based on past experiences?

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:** [July 5, 2017, 11:56pm UTC](https://discuss.elastic.co/t/returning-a-subset-of-nested-objects/26916/4 "2017-07-05T23:56:47Z")

</div>


