# What is depth weight represent in graph

**URL:** <https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733>\
**Category:** Kibana\
**Tags:** elastic-stack-graph\
**Created:** [January 2, 2018, 7:08am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733 "2018-01-02T07:08:42Z")\
**Posts on this page:** 10\
**Page:** 2

<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:** [January 8, 2018, 9:19am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/22 "2018-01-08T09:19:33Z")

</div>

> [@krishnaraj221193](#):
>
> i can see document with id=b is created twice which is duplicate

You may have confused my `id` field with elasticsearch's internal `_id` field. Maybe a less confusing choice of field name would be `person_id`. It is not a duplicate in my example and is a deliberate assertion required to express one of the relationships shown in the diagram.

> [@krishnaraj221193](#):
>
> { "id":1,"name":"a" }
> 
> { "id":2,"name":"b","parent":1 }

You will need to use the example format I provided rather than your example data above.

---

<div class="post-metadata">

**Author:** ![krishnaraj221193](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@krishnaraj221193](https://discuss.elastic.co/u/krishnaraj221193)\
**Post date:** [January 8, 2018, 10:41am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/23 "2018-01-08T10:41:21Z")

</div>

Hi sir thanks for the reply with your example it create 2 documents but internally document data will be same only for maintaining parent as A and child as C b data need to be entered 2 times

in my case there can be 1:n childrens so i cant able to create n parent document for n childs

---

<div class="post-metadata">

**Author:** ![krishnaraj221193](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@krishnaraj221193](https://discuss.elastic.co/u/krishnaraj221193)\
**Post date:** [January 8, 2018, 10:52am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/24 "2018-01-08T10:52:59Z")

</div>

hi sir basically i need parent child relationship for same index type which is not possible so we are using nested object but its difficult to maintain so is there a way to create relation for same type document

---

<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:** [January 8, 2018, 10:59am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/25 "2018-01-08T10:59:26Z")

</div>

My example was about parents in terms of fathers and mothers - not any elasticsearch notion of placing parent/child documents in the same shard. I'm still unclear as to exactly what business problem you are trying to solve.

If you are talking about using elasticsearch parent/child functionality to represent marriages (i.e. your "Anna --wife--\> dave" example) then this introduces some problems. How do you determine who is the "parent" document in a marriage? Is it always the male? Do you know the genders? What happens in a same-sex marriage? etc.

My examples can be used to express any relationship (wife/brother/mother/employer...) and do not mandate any physical co-location although clearly having everything in one place is always an advantage if the data volumes aren't too high.

---

<div class="post-metadata">

**Author:** ![krishnaraj221193](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@krishnaraj221193](https://discuss.elastic.co/u/krishnaraj221193)\
**Post date:** [January 8, 2018, 11:01am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/26 "2018-01-08T11:01:28Z")

</div>

hi sir basically i need parent child relationship for same index type which is not possible so we are using nested object but its difficult to maintain so is there a way to create relation for same type document

---

<div class="post-metadata">

**Author:** ![krishnaraj221193](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@krishnaraj221193](https://discuss.elastic.co/u/krishnaraj221193)\
**Post date:** [January 8, 2018, 11:03am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/27 "2018-01-08T11:03:32Z")

</div>

in windows if we click on folders properties we get total( files in that + files inside subfolder +files till nth level folder) how can i achive this using elasticsearch

---

<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:** [January 8, 2018, 11:05am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/28 "2018-01-08T11:05:34Z")

</div>

> [@krishnaraj221193](#):
>
> in windows if we click on folders properties we get total( files in that + files inside subfolder +files till nth level folder) how can i achive this using elasticsearch

That's not a graph API question. Please ask that in the elasticsearch forum.

---

<div class="post-metadata">

**Author:** ![krishnaraj221193](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@krishnaraj221193](https://discuss.elastic.co/u/krishnaraj221193)\
**Post date:** [January 8, 2018, 11:06am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/29 "2018-01-08T11:06:59Z")

</div>

ok thanks for the reply

---

<div class="post-metadata">

**Author:** ![krishnaraj221193](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@krishnaraj221193](https://discuss.elastic.co/u/krishnaraj221193)\
**Post date:** [January 8, 2018, 11:48am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/30 "2018-01-08T11:48:28Z")

</div>

In graph request if vertex has the fields then why is it required to add in connections and why exclude field is used in connections

---

<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:** [February 5, 2018, 11:48am UTC](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733/31 "2018-02-05T11:48:29Z")

</div>

Closed on February 5, 2018, 11:48am UTC

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

[Previous page](https://discuss.elastic.co/t/what-is-depth-weight-represent-in-graph/113733.md?page=1)
