# Generic child/parent relationships

**URL:** https://discuss.elastic.co/t/generic-child-parent-relationships/5959
**Category:** Elasticsearch
**Created:** [November 23, 2011, 10:02pm UTC](https://discuss.elastic.co/t/generic-child-parent-relationships/5959 "2011-11-23T22:02:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![George\_Sakkis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/george_sakkis/32/2801_2.png) [@George\_Sakkis](https://discuss.elastic.co/u/George_Sakkis)
#### Post date: [November 23, 2011, 10:02pm UTC](https://discuss.elastic.co/t/generic-child-parent-relationships/5959/1 "2011-11-23T22:02:11Z")

</div>

Hi all,

I'd like to index generic child/parent relationships, i.e. not requiring  
all children having a parent of the same type. For example instead of a  
"blog\_tag" child type with a "blog" parent type, an "article\_tag" child  
with an "article" parent type and so on, have a single "tag" child type  
with a (static or dynamic) set of possible parent types. If (as I can  
tell) elasticsearch doesn't support such functionality out of the box, what  
is a good way to work around this?

Thanks,  
George

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [November 24, 2011, 2:43pm UTC](https://discuss.elastic.co/t/generic-child-parent-relationships/5959/2 "2011-11-24T14:43:20Z")

</div>

You have to specify in the mapping of the child its parent.

On Thu, Nov 24, 2011 at 12:02 AM, George Sakkis [george.sakkis@gmail.com](mailto:george.sakkis@gmail.com)wrote:

> Hi all,
> 
> I'd like to index generic child/parent relationships, i.e. not requiring  
> all children having a parent of the same type. For example instead of a  
> "blog\_tag" child type with a "blog" parent type, an "article\_tag" child  
> with an "article" parent type and so on, have a single "tag" child type  
> with a (static or dynamic) set of possible parent types. If (as I can  
> tell) elasticsearch doesn't support such functionality out of the box, what  
> is a good way to work around this?
> 
> Thanks,  
> George

---

<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, 3:47am UTC](https://discuss.elastic.co/t/generic-child-parent-relationships/5959/3 "2017-07-06T03:47:35Z")

</div>


