# \[Elasticsearch 1.0.0.RC1\] Recursive Parent/Child Aggs

**URL:** <https://discuss.elastic.co/t/elasticsearch-1-0-0-rc1-recursive-parent-child-aggs/15301>\
**Category:** Elasticsearch\
**Created:** [January 17, 2014, 8:21pm UTC](https://discuss.elastic.co/t/elasticsearch-1-0-0-rc1-recursive-parent-child-aggs/15301 "2014-01-17T20:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Bockholt](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Tiago\_Bockholt](https://discuss.elastic.co/u/Tiago_Bockholt)\
**Post date:** [January 17, 2014, 8:21pm UTC](https://discuss.elastic.co/t/elasticsearch-1-0-0-rc1-recursive-parent-child-aggs/15301/1 "2014-01-17T20:21:39Z")

</div>

Hello,

I am aware of a Parent/Child Relationship in ES by using the \_parent field.  
However, I would like to ask if there is some way to aggregate measures in  
a recursive manner. For example, I would like to perform a query to ES and  
have the children of children aggregation. Let me instantiate it:

Consider that I have the following docs inside an ordinary index:

## id | idParent | Measure

1 | | 0  
2 | 1 | 0  
3 | 2 | 1  
4 | 2 | 1  
5 | 2 | 1

this docs tell me(in a recursive manner) that doc with id={2,3,4,5} are all  
children of doc with id ={1}. So, if I aggregate the childrens, I would  
have 3 as result instead of 0 (if I only consider doc with id=2 as the  
single child of doc with id =1).

Does anyone knows how to perform such query to 1.0.0.RC1 ?

Regards from sunny Brazil.

--  
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/b36089ff-58c0-4815-ac8d-ee2833a44ee0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b36089ff-58c0-4815-ac8d-ee2833a44ee0%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:56am UTC](https://discuss.elastic.co/t/elasticsearch-1-0-0-rc1-recursive-parent-child-aggs/15301/2 "2017-07-06T01:56:08Z")

</div>


