# Pull data from multiple index

**URL:** https://discuss.elastic.co/t/pull-data-from-multiple-index/368843
**Category:** Elasticsearch
**Created:** [October 15, 2024, 11:15am UTC](https://discuss.elastic.co/t/pull-data-from-multiple-index/368843 "2024-10-15T11:15:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![charleskingsley](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@charleskingsley](https://discuss.elastic.co/u/charleskingsley)
#### Post date: [October 15, 2024, 11:15am UTC](https://discuss.elastic.co/t/pull-data-from-multiple-index/368843/1 "2024-10-15T11:15:48Z")

</div>

I am having 2 index as follows, this is a sample index. My request is to get Employees from employee-details-v1 index whose course is dotnet. Need to get this in single ES Query not in 2 steps

It's a sample index. Same need to be applied to my prod data. Is there is any way to achieve this without changing the index structure.

```auto

{
        "_index": "employee-courses-v2",
        "_id": "3",
        "_score": 0.4700036,
        "_source": {
          "empid": 3,
          "courses": [
            "python",
            "dotnet"
          ]
        }
      }

{
        "_index": "employee-details-v1",
        "_id": "2",
        "_score": 1,
        "_source": {
          "empid": 2,
          "namefirst": "Matthew",
          "namelast": "Baren"
        }
      }

```

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [October 15, 2024, 12:01pm UTC](https://discuss.elastic.co/t/pull-data-from-multiple-index/368843/2 "2024-10-15T12:01:24Z")

</div>

Hello and welcome,

What you want to do is a join, this is not supported in Elasticsearch, you need to normalize your data or do multiple queries and join the results in your code.

> [@charleskingsley](#):
>
> Is there is any way to achieve this without changing the index structure.

There is not, if you want to get information from both employee-courses index and employee-details you will need to change your index and normalize your data.

For example, you would need to add the information from employee-details into the employee-courses.

Your document would be something like this:

```auto
{
  "empid": 3,
  "courses": [
    "python",
    "dotnet"
  ],
  "namefirst": "first name of empid 3",
  "namelast": "last name of empid 3",
}

```
