# Joining 2 indices in Elasticsearch

**URL:** <https://discuss.elastic.co/t/joining-2-indices-in-elasticsearch/11678>\
**Category:** Elasticsearch\
**Created:** [April 24, 2013, 6:46am UTC](https://discuss.elastic.co/t/joining-2-indices-in-elasticsearch/11678 "2013-04-24T06:46:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shgeorge](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@shgeorge](https://discuss.elastic.co/u/shgeorge)\
**Post date:** [April 24, 2013, 6:46am UTC](https://discuss.elastic.co/t/joining-2-indices-in-elasticsearch/11678/1 "2013-04-24T06:46:41Z")

</div>

Hi ES team  
Is it possible to join multiple indices based on a common id and apply  
filters?  
Eg :  
Index1 has  
itemId, Desc, ProdId  
Index2 has  
ProdId and Price

We need to return all the items where the price is in a particular range.  
Is it possible without having all the data in 1 single index?

Thanks and regards  
George

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![q42jaap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/q42jaap/32/2241_2.png) [@q42jaap](https://discuss.elastic.co/u/q42jaap)\
**Post date:** [April 24, 2013, 7:29am UTC](https://discuss.elastic.co/t/joining-2-indices-in-elasticsearch/11678/2 "2013-04-24T07:29:36Z")

</div>

Hi George,

This is not possible, elasticsearch, like any NOSQL db, doesn't do joins.  
You can do it yourself, i.e. join in code, or use parent/child relations,  
or nested document.

Depending on your usecase, denormalizing the prices documents and deduping  
on product id may also be an option.

Jaap  
On Apr 24, 2013 8:46 AM, "Sheeba George" [sheeba.george@gmail.com](mailto:sheeba.george@gmail.com) wrote:

> Hi ES team  
> Is it possible to join multiple indices based on a common id and apply  
> filters?  
> Eg :  
> Index1 has  
> itemId, Desc, ProdId  
> Index2 has  
> ProdId and Price
> 
> We need to return all the items where the price is in a particular range.  
> Is it possible without having all the data in 1 single index?
> 
> Thanks and regards  
> George
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Filippo\_Rossoni](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@Filippo\_Rossoni](https://discuss.elastic.co/u/Filippo_Rossoni)\
**Post date:** [April 25, 2013, 2:00pm UTC](https://discuss.elastic.co/t/joining-2-indices-in-elasticsearch/11678/3 "2013-04-25T14:00:23Z")

</div>

I found this interesting article  
[http://blog.squirro.com/post/45191175546/elasticsearch-and-joining](http://blog.squirro.com/post/45191175546/elasticsearch-and-joining)  
look at parent/child relationship

Il giorno mercoledì 24 aprile 2013 08:46:41 UTC+2, george ha scritto:

> Hi ES team  
> Is it possible to join multiple indices based on a common id and apply  
> filters?  
> Eg :  
> Index1 has  
> itemId, Desc, ProdId  
> Index2 has  
> ProdId and Price
> 
> We need to return all the items where the price is in a particular range.  
> Is it possible without having all the data in 1 single index?
> 
> Thanks and regards  
> George

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:39am UTC](https://discuss.elastic.co/t/joining-2-indices-in-elasticsearch/11678/4 "2017-07-06T02:39:37Z")

</div>


