# Two index with same field cant be merged as single document

**URL:** <https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845>\
**Category:** Kibana\
**Created:** [March 12, 2019, 12:20am UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845 "2019-03-12T00:20:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_Krishnan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishnan/32/66696_2.png) [@Hari\_Krishnan](https://discuss.elastic.co/u/Hari_Krishnan)\
**Post date:** [March 12, 2019, 12:20am UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/1 "2019-03-12T00:20:18Z")

</div>

Hi i'm new to Kibana.

I tried to merge two index into a single document but failed

Here what i did:

1. Created index as index11 and index12
2. Created index pattern as index1\*
3. then in Discover tab i can see filed of two index like below

![actual](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f3980792efbc8557b81d6c5ea3358522039e2b3.jpeg)

what i want ?  
 ![expected](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca51adafd3691f6a75d91b6c8c7882644fc5d883.jpeg)

i want like this for my further filtering and visualization

Thanks in advance

---

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [March 12, 2019, 4:40pm UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/2 "2019-03-12T16:40:36Z")

</div>

Hi, please check the mappings of your two indices. You can do this from Dev Tools:

```auto
GET your-index-name/_mapping

```

Make sure that your common field of the two indices have the same mapping. If they don't, you'll want to update your mappings and reindex your data.

---

<div class="post-metadata">

**Author:** ![Hari\_Krishnan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishnan/32/66696_2.png) [@Hari\_Krishnan](https://discuss.elastic.co/u/Hari_Krishnan)\
**Post date:** [March 14, 2019, 12:29pm UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/3 "2019-03-14T12:29:33Z")

</div>

Hi , I tried both are in having same mapping

can you tell the place where i need to mention the common field which is present in two indexes ?

![tele1](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b74dc2d152adb2f350c09c43a9cb374e65e311ac.jpeg)

![tele2](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9f8453268796283241bcb9d6deea6c33e9fe42be.jpeg)

---

<div class="post-metadata">

**Author:** ![Hari\_Krishnan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_krishnan/32/66696_2.png) [@Hari\_Krishnan](https://discuss.elastic.co/u/Hari_Krishnan)\
**Post date:** [March 21, 2019, 10:00am UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/4 "2019-03-21T10:00:18Z")

</div>

Any comments ?

---

<div class="post-metadata">

**Author:** ![RonGros](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@RonGros](https://discuss.elastic.co/u/RonGros)\
**Post date:** [April 14, 2019, 6:23am UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/6 "2019-04-14T06:23:41Z")

</div>

Good question!

---

<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:** [April 14, 2019, 6:36am UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/7 "2019-04-14T06:36:16Z")

</div>

The two lines correspond to two different documents and as these have different sets of fields you see this. Displaying the data the way you would like would require a join on the common field. This is not possible as Elasticsearch does not support joins.

---

<div class="post-metadata">

**Author:** ![RonGros](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@RonGros](https://discuss.elastic.co/u/RonGros)\
**Post date:** [April 14, 2019, 12:54pm UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/8 "2019-04-14T12:54:19Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> different documents and as these have different sets of fields you see this. Displaying the data the way you would like would require a join on the common field. This is not possible as Elasticsearch does not support joins.

And assuming all fields were the same? is there a way to join the two indices?

---

<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 12, 2019, 12:54pm UTC](https://discuss.elastic.co/t/two-index-with-same-field-cant-be-merged-as-single-document/171845/9 "2019-05-12T12:54:20Z")

</div>

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