# Can we perform joins on the Indexes in ES?

**URL:** https://discuss.elastic.co/t/can-we-perform-joins-on-the-indexes-in-es/130122
**Category:** Kibana
**Created:** [May 1, 2018, 1:22pm UTC](https://discuss.elastic.co/t/can-we-perform-joins-on-the-indexes-in-es/130122 "2018-05-01T13:22:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![manjur](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@manjur](https://discuss.elastic.co/u/manjur)
#### Post date: [May 1, 2018, 1:22pm UTC](https://discuss.elastic.co/t/can-we-perform-joins-on-the-indexes-in-es/130122/1 "2018-05-01T13:22:54Z")

</div>

Hi,

I have shipped data from sql server to ES using logstash. I have created two indexes in Kibana,. I just want to join two documents to get required results.

---

<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 1, 2018, 2:18pm UTC](https://discuss.elastic.co/t/can-we-perform-joins-on-the-indexes-in-es/130122/2 "2018-05-01T14:18:18Z")

</div>

Elasticsearch and Kibana does not support joins, so when working with relational data it is generally recommended to denormalise data into entities that match what you will be searching for before you ingest the data. If you can provide a bit more information about your data and how you want to query it, someone might be able to help come up with a solution.

---

<div class="post-metadata">

### Author: ![darkmoon](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@darkmoon](https://discuss.elastic.co/u/darkmoon)
#### Post date: [May 1, 2018, 3:02pm UTC](https://discuss.elastic.co/t/can-we-perform-joins-on-the-indexes-in-es/130122/3 "2018-05-01T15:02:47Z")

</div>

Lack of joins/subqueries/sequential queries is the biggest flaw in Elastic. (Yes, they're expensive, but forcing users to work around that is annoying and even more expensive.)

@manjur - another option is to script some queries at the API. You can can than use the results of the first query to build the second (which is all a sub query is doing under the hood). This works pretty well if your data isn't something that de-normalizes well.

---

<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: [May 29, 2018, 3:07pm UTC](https://discuss.elastic.co/t/can-we-perform-joins-on-the-indexes-in-es/130122/4 "2018-05-29T15:07:27Z")

</div>

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