# Mapper Attachment in creating relationship

**URL:** <https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558>\
**Category:** Elasticsearch\
**Created:** [June 13, 2016, 3:39am UTC](https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558 "2016-06-13T03:39:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)\
**Post date:** [June 13, 2016, 3:39am UTC](https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558/1 "2016-06-13T03:39:18Z")

</div>

I am using mapper attachment plugin and creating different data with different ids. How can I create mapping relationship between data so that I am able to make relationship between data.

For example, I have input data with content include "Kobe Bryant" in id=1 and with content include "Mamba" in id=2. How can I make them two related so when I search Kobe Bryant, the term "Mamba" will also appear?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 13, 2016, 4:47am UTC](https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558/2 "2016-06-13T04:47:56Z")

</div>

What would the relationship based on?

---

<div class="post-metadata">

**Author:** ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)\
**Post date:** [June 13, 2016, 4:15pm UTC](https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558/3 "2016-06-13T16:15:45Z")

</div>

Like linking them that they are the same person

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 13, 2016, 5:20pm UTC](https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558/4 "2016-06-13T17:20:08Z")

</div>

I don't think you can.  
May be Graph API could do this though.

Or running an aggregation on author field with top hits then???

---

<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 5, 2017, 10:44pm UTC](https://discuss.elastic.co/t/mapper-attachment-in-creating-relationship/52558/5 "2017-07-05T22:44:16Z")

</div>


