# Graphing parent-child relationship tree

**URL:** <https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862>\
**Category:** Kibana\
**Tags:** elastic-stack-graph\
**Created:** [June 15, 2016, 12:41pm UTC](https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862 "2016-06-15T12:41:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dandrestor](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dandrestor](https://discuss.elastic.co/u/dandrestor)\
**Post date:** [June 15, 2016, 12:41pm UTC](https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862/1 "2016-06-15T12:41:52Z")

</div>

Hi there,

I have records in elastic search which have a parent-child relationship which forms a tree. This is represented using two fields, let's say `id` and `parent_id`. I would like to use graph to obtain a visual representation of this tree.

Right now, I am using the following settings:

- In Graph settings:
- Significant links disabled
- Certainty = 1
- In graph advanced mode, I am selecting only the two relevant fields, `id` and `parent_id`.

When running a query, unfortunately, Graph only plots one depth level of the parent-child relationship. It looks something like this (excuse my ASCII art):

(`id child1`)----------(`parent_id parent1`)-----------(`id child2`)

(`id parent1`)------------(`parent_id grandparent`)

What I would like, of course, is to join the two separate structures into something like this:

(`id child1`)--------  
(`id child2`)---------(`id parent1`)-----------(`id grandparent`)

Any ideas are greatly appreciated. Thanks!

Dan

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [June 15, 2016, 4:06pm UTC](https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862/2 "2016-06-15T16:06:17Z")

</div>

This looks like a duplicate of this question: [Can graph query (non-cyclic, non-duplicated) ancestors and descendants?](https://discuss.elastic.co/t/can-graph-query-non-cyclic-non-duplicated-ancestors-and-descendants/49339)

---

<div class="post-metadata">

**Author:** ![will.archive](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/will.archive/32/9616_2.png) [@will.archive](https://discuss.elastic.co/u/will.archive)\
**Post date:** [June 15, 2016, 4:51pm UTC](https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862/3 "2016-06-15T16:51:41Z")

</div>

And it sure would be great to have a solution for this!

---

<div class="post-metadata">

**Author:** ![dandrestor](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dandrestor](https://discuss.elastic.co/u/dandrestor)\
**Post date:** [June 16, 2016, 7:31am UTC](https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862/4 "2016-06-16T07:31:24Z")

</div>

Indeed it is! Thanks Mark.

---

<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:43pm UTC](https://discuss.elastic.co/t/graphing-parent-child-relationship-tree/52862/5 "2017-07-06T13:43:08Z")

</div>


