# Relationships among entities with graph

**URL:** <https://discuss.elastic.co/t/relationships-among-entities-with-graph/50959>\
**Category:** Kibana\
**Tags:** elastic-stack-graph\
**Created:** [May 25, 2016, 3:58pm UTC](https://discuss.elastic.co/t/relationships-among-entities-with-graph/50959 "2016-05-25T15:58:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nagate](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nagate](https://discuss.elastic.co/u/nagate)\
**Post date:** [May 25, 2016, 3:58pm UTC](https://discuss.elastic.co/t/relationships-among-entities-with-graph/50959/1 "2016-05-25T15:58:15Z")

</div>

I've indexed some sample data in my elastic node. I can search and retrieve the documents. Now I am trying to see the relationships between these documents using Graph plugin. I've attached a sample document from my index. I want to build the relationship if the entities "\_id" field is in another documents "source-entity-ids" field. i.e. show entity 1 is derived from entity 2 and 3.  
In kibana I can see my index name and the fields in it, along with a query field. But I am not sure how I can create this relationship. I've tried few things but am not getting any results back.

{  
\_index: "sample",  
\_type: "entity",  
\_id: "1",  
\_version: 5,  
found: true,  
\_source: {  
entity\_name: "Some war file",  
category: "AWS\_S3\_object",  
source\_entity\_ids: [2, 3]  
}  
}

---

<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:** [May 26, 2016, 7:58am UTC](https://discuss.elastic.co/t/relationships-among-entities-with-graph/50959/2 "2016-05-26T07:58:12Z")

</div>

> [@nagate](#):
>
> I want to build the relationship if the entities "\_id" field is in another documents "source-entity-ids" field

Currently, and for reasons of simplicity, we don't provide a way for you to declare that values found in field X can be looked for in field Y. We could conceivably go further and say that field Y is in a different index. Such a mapping will require detailed configuration and so is not in the current release.

For now, you'll need to create a single "ids" field with an array containing both parent and child IDs.  
Because all of these IDs are in the same document in your example you'd end up with a triangle with links 1-\>2, 1-\>3 and 2-\>3. If you want to avoid the 2-\>3 association you would have to create individual docs to express just the 1-\>2 and 1-\>3 pairings - these docs would be more reminiscent of the "edge" objects in a classic graph DB.

> [@nagate](#):
>
> I've tried few things but am not getting any results back

The troubleshooting guide has a section on adjusting the link relevance settings in the API. In the GUI, these are controlled by turning "significant\_links" off and setting the certainty threshold to 1.

[1] [\_id field | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-id-field.html)  
[2] [Troubleshooting | Elasticsearch Graph [2.4] | Elastic](https://www.elastic.co/guide/en/graph/current/graph-troubleshooting.html#_why_are_results_missing)

---

<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/relationships-among-entities-with-graph/50959/3 "2017-07-06T13:43:25Z")

</div>


