# Multiple join in one index

**URL:** <https://discuss.elastic.co/t/multiple-join-in-one-index/117412>\
**Category:** Elasticsearch\
**Created:** [January 29, 2018, 8:06am UTC](https://discuss.elastic.co/t/multiple-join-in-one-index/117412 "2018-01-29T08:06:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordWeedlle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lordweedlle/32/27066_2.png) [@LordWeedlle](https://discuss.elastic.co/u/LordWeedlle)\
**Post date:** [January 29, 2018, 8:06am UTC](https://discuss.elastic.co/t/multiple-join-in-one-index/117412/1 "2018-01-29T08:06:14Z")

</div>

Hi,

I am currently updating my mapping so I can upgrade ES to version 6.  
I have a question, at the moment I have 2 parent-child relation in my mapping:  
User (parent of) Question (parent of) Answer

In [join quide](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/parent-join.html#_parent_join_restrictions) it is specified that only **one** join field can be used in an index.

Does anyone knows how I can achieve getting my mapping work in ES6 ?

---

<div class="post-metadata">

**Author:** ![jimczi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimczi/32/47985_2.png) [@jimczi](https://discuss.elastic.co/u/jimczi)\
**Post date:** [January 29, 2018, 8:40am UTC](https://discuss.elastic.co/t/multiple-join-in-one-index/117412/2 "2018-01-29T08:40:00Z")

</div>

The new `parent_join` field can handle multiple relations in a single field. The note in the documentation about using only one join field does not mean that you cannot have multiple relations but rather that all your relations must be defined in a single field. You can check this example that shows how to define multiple levels of relations:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html#\_multiple\_levels\_of\_parent\_join](https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html#_multiple_levels_of_parent_join)

---

<div class="post-metadata">

**Author:** ![LordWeedlle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lordweedlle/32/27066_2.png) [@LordWeedlle](https://discuss.elastic.co/u/LordWeedlle)\
**Post date:** [January 29, 2018, 9:46am UTC](https://discuss.elastic.co/t/multiple-join-in-one-index/117412/3 "2018-01-29T09:46:33Z")

</div>

Damn perfect, I misunderstood this line.  
Thanks for the answer =)

---

<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 26, 2018, 9:46am UTC](https://discuss.elastic.co/t/multiple-join-in-one-index/117412/4 "2018-02-26T09:46:38Z")

</div>

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