# Can we join two indexes.?

**URL:** <https://discuss.elastic.co/t/can-we-join-two-indexes/139128>\
**Category:** Elasticsearch\
**Created:** [July 9, 2018, 9:59am UTC](https://discuss.elastic.co/t/can-we-join-two-indexes/139128 "2018-07-09T09:59:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajit](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@ajit](https://discuss.elastic.co/u/ajit)\
**Post date:** [July 9, 2018, 9:59am UTC](https://discuss.elastic.co/t/can-we-join-two-indexes/139128/1 "2018-07-09T09:59:32Z")

</div>

Hi,  
While fetching data from elasticsearch can we join two indexes in query. Is it possible?

---

<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:** [July 9, 2018, 10:01am UTC](https://discuss.elastic.co/t/can-we-join-two-indexes/139128/2 "2018-07-09T10:01:38Z")

</div>

No, Elasticsearch does not support joins between indices. There is some [limited join-like behaviour](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/parent-join.html) within an index, but this comes with a number of restrictions so it is generally recommended to denormalise your data for best performance.

---

<div class="post-metadata">

**Author:** ![mikebd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikebd/32/33437_2.png) [@mikebd](https://discuss.elastic.co/u/mikebd)\
**Post date:** [July 17, 2018, 9:56pm UTC](https://discuss.elastic.co/t/can-we-join-two-indexes/139128/3 "2018-07-17T21:56:57Z")

</div>

Yes, if you create an index alias that covers both indexes and then search against the alias.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html)

---

<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:** [August 14, 2018, 9:57pm UTC](https://discuss.elastic.co/t/can-we-join-two-indexes/139128/4 "2018-08-14T21:57:03Z")

</div>

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