# Is there a query similar to joins in Elasticsearch?

**URL:** https://discuss.elastic.co/t/is-there-a-query-similar-to-joins-in-elasticsearch/99084
**Category:** Elasticsearch
**Created:** [September 1, 2017, 5:09am UTC](https://discuss.elastic.co/t/is-there-a-query-similar-to-joins-in-elasticsearch/99084 "2017-09-01T05:09:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Yungyoung\_Ok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yungyoung_ok/32/43465_2.png) [@Yungyoung\_Ok](https://discuss.elastic.co/u/Yungyoung_Ok)
#### Post date: [September 1, 2017, 5:09am UTC](https://discuss.elastic.co/t/is-there-a-query-similar-to-joins-in-elasticsearch/99084/1 "2017-09-01T05:09:58Z")

</div>

Hello.  
I know its not efficient to use "JOIN" in Elasticsearch, but I need to use it.  
I have to extract values by find same field of index A and index B.  
there is an example below.

A/type1/1  
{  
"serial":"abc",  
"member":"jack"  
}

A/type1/2  
{  
"serial":"def",  
"member":"jack"  
}

B/type2/1  
{  
"serial":"abc",  
"temp":1  
}

B/type3/2  
{  
"serial":"abc",  
"water":0  
}

B/type2/3  
{  
"serial":"def",  
"temp":10  
}

I need to filter the value of the 'member' field of the A index to find the corresponding 'serial', and then I want to get the values ​​of the 'temp' and 'water' fields in the B index.  
ex) filter:{"member":"jack"} ===\> temp:1, water:0, temp:10

I wonder if I can get this result, and if so, how do i establish the data structure (index structure).

---

<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: [September 29, 2017, 5:10am UTC](https://discuss.elastic.co/t/is-there-a-query-similar-to-joins-in-elasticsearch/99084/2 "2017-09-29T05:10:03Z")

</div>

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