# Join clause in ES, what's the alternatives

**URL:** <https://discuss.elastic.co/t/join-clause-in-es-whats-the-alternatives/82562>\
**Category:** Elasticsearch\
**Created:** [April 17, 2017, 10:04am UTC](https://discuss.elastic.co/t/join-clause-in-es-whats-the-alternatives/82562 "2017-04-17T10:04:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iheb](https://avatars.discourse-cdn.com/v4/letter/i/7bcc69/32.png) [@iheb](https://discuss.elastic.co/u/iheb)\
**Post date:** [April 17, 2017, 10:04am UTC](https://discuss.elastic.co/t/join-clause-in-es-whats-the-alternatives/82562/1 "2017-04-17T10:04:10Z")

</div>

Hi everyone,

I have two types in my index;  
Type1 contain two fields: developer—name & project—name  
Type2 contain two fields: developer—name & team—name

What I want is to have the team—name field related to the first type with the developer associated to it.  
I noticed that the join relation is not an option in ES.

Could some one help me out with this?

Thanks

---

<div class="post-metadata">

**Author:** ![EikeD](https://avatars.discourse-cdn.com/v4/letter/e/74df32/32.png) [@EikeD](https://discuss.elastic.co/u/EikeD)\
**Post date:** [April 17, 2017, 1:36pm UTC](https://discuss.elastic.co/t/join-clause-in-es-whats-the-alternatives/82562/2 "2017-04-17T13:36:55Z")

</div>

In Elasticsearch it's common to denormalize data, basically making one big flat "table" , then you can write the above as a simple query/aggregation.

Elastic is not a relational detabase, and the data model you' re describing is something that works in an SQL database, but not so much in elastic.

There is some (limited) possibilites for relations in elastic (parent/child , nested docs , terms lookup) but i think denormalizing is probably most suitable to what you describe above.

---

<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:** [May 15, 2017, 1:46pm UTC](https://discuss.elastic.co/t/join-clause-in-es-whats-the-alternatives/82562/3 "2017-05-15T13:46:15Z")

</div>

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