# Parent, Child and Grand child, nested together

**URL:** https://discuss.elastic.co/t/parent-child-and-grand-child-nested-together/85616
**Category:** Elasticsearch
**Created:** [May 12, 2017, 7:39pm UTC](https://discuss.elastic.co/t/parent-child-and-grand-child-nested-together/85616 "2017-05-12T19:39:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ArunANayagam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arunanayagam/32/45171_2.png) [@ArunANayagam](https://discuss.elastic.co/u/ArunANayagam)
#### Post date: [May 12, 2017, 7:39pm UTC](https://discuss.elastic.co/t/parent-child-and-grand-child-nested-together/85616/1 "2017-05-12T19:39:21Z")

</div>

Hi,

I am using elasticsearch 2.4.0

For the use case I have, parent child and grand children works best and I was able to set them up fine.

I set,

1. Grand childs parent as, child
2. Childs parent as, parent
3. Set the routing of both grand child and child as parent, so that they all reside on the same shard.

All is fine and I am able to run some basic queries.

But I am not able to retrieve parent/child/grand child in a nested format.

I want to fetch parent/child/grand child, based on parent's id.

Is that possible?

I am willing to upgrade if this is possible in a higher version.

Thanks,  
Arun

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [May 14, 2017, 8:39am UTC](https://discuss.elastic.co/t/parent-child-and-grand-child-nested-together/85616/2 "2017-05-14T08:39:11Z")

</div>

As the documents are all separate documents that are linked through a field rather than nested, I do not think this is possible.

---

<div class="post-metadata">

### Author: ![ArunANayagam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arunanayagam/32/45171_2.png) [@ArunANayagam](https://discuss.elastic.co/u/ArunANayagam)
#### Post date: [May 17, 2017, 11:34am UTC](https://discuss.elastic.co/t/parent-child-and-grand-child-nested-together/85616/3 "2017-05-17T11:34:53Z")

</div>

Hi Christian,

Thanks for the reply.  
Feels counter intuitive, that we take the effort to mark different documents as parents and children, but you can't see them all together.  
Perhaps an RDBMS hangover 😄

Thanks,  
Arun

---

<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: [June 14, 2017, 11:35am UTC](https://discuss.elastic.co/t/parent-child-and-grand-child-nested-together/85616/4 "2017-06-14T11:35:00Z")

</div>

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