# Doubt Related using multiple indexes or Join

**URL:** <https://discuss.elastic.co/t/doubt-related-using-multiple-indexes-or-join/182692>\
**Category:** Elasticsearch\
**Created:** [May 24, 2019, 3:31pm UTC](https://discuss.elastic.co/t/doubt-related-using-multiple-indexes-or-join/182692 "2019-05-24T15:31:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit\_sachdeva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amit_sachdeva/32/46819_2.png) [@amit\_sachdeva](https://discuss.elastic.co/u/amit_sachdeva)\
**Post date:** [May 24, 2019, 3:31pm UTC](https://discuss.elastic.co/t/doubt-related-using-multiple-indexes-or-join/182692/1 "2019-05-24T15:31:12Z")

</div>

I am creating two different indexes but both are related to each other like a foreign key. I want to search results in both indexes using some fields indexed in both indexes. First index is storing data of users and other index is storing its documents. First we decide if we can use nested documents in single index. But I don't know can we add documents dynamically in nested or not? If not, can anyone suggest what is best way to search in both indexes?

---

<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:** [May 24, 2019, 8:26pm UTC](https://discuss.elastic.co/t/doubt-related-using-multiple-indexes-or-join/182692/2 "2019-05-24T20:26:07Z")

</div>

Elasticsearch does not support any kind of joins across indices so you may need to run two separate queries and perform the join at the application layer. Using nested documents or parent-child relationships as a substitute for a join is often not a good idea as it is not a join. It is often recommended that you try to denormalize data in E Elasticsearch rather than try to keep some relational model.

---

<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:** [June 21, 2019, 8:26pm UTC](https://discuss.elastic.co/t/doubt-related-using-multiple-indexes-or-join/182692/3 "2019-06-21T20:26:13Z")

</div>

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