# How to fetch data from multiple index using join like sql

**URL:** <https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-index-using-join-like-sql/106131>\
**Category:** Elasticsearch\
**Created:** [November 2, 2017, 7:13am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-index-using-join-like-sql/106131 "2017-11-02T07:13:40Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![kanchan](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kanchan](https://discuss.elastic.co/u/kanchan)\
**Post date:** [November 3, 2017, 7:33am UTC](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-index-using-join-like-sql/106131/5 "2017-11-03T07:33:23Z")

</div>

Hi David, I prefer this example of normalization.

```auto
PUT /my_index/user/1
{
  "name": "John Smith",
  "email": "john@smith.com",
  "dob": "1970/10/24"
}

PUT /my_index/blogpost/2
{
  "title": "Relationships",
  "body": "It's complicated...",
  "user": {
    "id": 1,
    "name": "John Smith" 
  }
}

```

for fetching records used:

```auto
GET /my_index/blogpost/_search
{
  "query": {
    "bool": {
      "must": [
        { "match": { "title": "relationships" }},
        { "match": { "user.name": "John" }}
      ]
    }
  }
}

```

sorry if I am asking wrong query but i am the new beginner for elasticsearch.

I tried to use `{"match": { "Wallet_Location_Dim.wallet_location_id": "User_Wallet_Location.wallet_location_id" }}`  
at d place of this `{ "match": { "user.name": "John" }}`

---

_[View the full topic](https://discuss.elastic.co/t/how-to-fetch-data-from-multiple-index-using-join-like-sql/106131)._
