# Parent Child Relationships within a single index with same document types

**URL:** https://discuss.elastic.co/t/parent-child-relationships-within-a-single-index-with-same-document-types/102014
**Category:** Logstash
**Created:** [September 27, 2017, 5:40pm UTC](https://discuss.elastic.co/t/parent-child-relationships-within-a-single-index-with-same-document-types/102014 "2017-09-27T17:40:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Stephen\_Le\_Bel](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Stephen\_Le\_Bel](https://discuss.elastic.co/u/Stephen_Le_Bel)
#### Post date: [September 27, 2017, 5:40pm UTC](https://discuss.elastic.co/t/parent-child-relationships-within-a-single-index-with-same-document-types/102014/1 "2017-09-27T17:40:40Z")

</div>

Is there a way to have a parent child relationship built between 2 documents of the same type in the same index?

I used this example, but type is the same as my\_parent  
PUT my\_index  
{  
"mappings": {  
"my\_parent": {},  
"my\_child": {  
"\_parent": {  
"type": "my\_parent"  
}  
}  
}  
}  
I am trying to graph the relationships but it is only one direction as parent is specified and children are not.

The Data feed has this data  
{  
"id": "59cbde1446583e3f80010163",  
"parent": "59cab84446583e3f8000bb94",  
}

---

<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: [October 25, 2017, 5:40pm UTC](https://discuss.elastic.co/t/parent-child-relationships-within-a-single-index-with-same-document-types/102014/2 "2017-10-25T17:40:49Z")

</div>

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