# Interesting question regarding "Joins"

**URL:** https://discuss.elastic.co/t/interesting-question-regarding-joins/37079
**Category:** Elasticsearch
**Created:** [December 14, 2015, 2:20am UTC](https://discuss.elastic.co/t/interesting-question-regarding-joins/37079 "2015-12-14T02:20:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cpattonj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cpattonj/32/4365_2.png) [@cpattonj](https://discuss.elastic.co/u/cpattonj)
#### Post date: [December 14, 2015, 2:20am UTC](https://discuss.elastic.co/t/interesting-question-regarding-joins/37079/1 "2015-12-14T02:20:51Z")

</div>

> <https://stackoverflow.com/questions/31568180/elasticsearch-join-columns-from-different-index-with-condition>

I had this very same question with respect to user metadata. In my use-case the decoration task for logs is quite expensive despite using redis to hold all of my metadata.

In an effort to minimize the load on the decorator (since it's already experiencing load from the current system in place), I thought it would be a good idea to re-index our metadata from scratch into it's own elasticsearch index and then "somehow magically" correlate the user data to a field like userid in elasticsearch.

I'm just not sure what the "somewhat magical" component to this is. 😄

Help would be appreciated! Please let me know if this needs anymore details. The Stackoverflow post is not mine, just referencing.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 14, 2015, 6:33am UTC](https://discuss.elastic.co/t/interesting-question-regarding-joins/37079/2 "2015-12-14T06:33:02Z")

</div>

Elasticsearch is not a relational system and does not support joins between indices, so unfortunately I don't think there is any "magical" component that can solve your problem. Support for parent-child relationships exists, but this requires all documents in the relationship to be located in the same shard, which makes it quite difficult to use with time based indices.

---

<div class="post-metadata">

### Author: ![german23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/german23/32/11052_2.png) [@german23](https://discuss.elastic.co/u/german23)
#### Post date: [December 14, 2015, 7:31am UTC](https://discuss.elastic.co/t/interesting-question-regarding-joins/37079/3 "2015-12-14T07:31:38Z")

</div>

Although elasticsearch is not an relational system, you could "cheat" and set up an apache hadoop with apache HIVE as query infrastructure and use the great elasticsearch-hadoop connector to stream your data from Elasticsearch in realtime.

In HIVE (and its metastore) you can then set up relational tables, where each table represents an elasticsearch query and than further do joins with the created tables.

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [December 14, 2015, 5:09pm UTC](https://discuss.elastic.co/t/interesting-question-regarding-joins/37079/4 "2015-12-14T17:09:08Z")

</div>

There is this old pull request that might help you (if it works):

> <https://github.com/elastic/elasticsearch/pull/3278>

From my understanding from the Elastic team, this PR will not be merged.

Ivan

---

<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, 11:31pm UTC](https://discuss.elastic.co/t/interesting-question-regarding-joins/37079/5 "2017-07-05T23:31:15Z")

</div>


