# How to Merge 2-index data in to One of the two Self Indexes without Re-Indexing to Third Index?

**URL:** <https://discuss.elastic.co/t/how-to-merge-2-index-data-in-to-one-of-the-two-self-indexes-without-re-indexing-to-third-index/242359>\
**Category:** Elasticsearch\
**Created:** [July 23, 2020, 2:54pm UTC](https://discuss.elastic.co/t/how-to-merge-2-index-data-in-to-one-of-the-two-self-indexes-without-re-indexing-to-third-index/242359 "2020-07-23T14:54:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dillibabu.mekala](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dillibabu.mekala](https://discuss.elastic.co/u/dillibabu.mekala)\
**Post date:** [July 23, 2020, 2:54pm UTC](https://discuss.elastic.co/t/how-to-merge-2-index-data-in-to-one-of-the-two-self-indexes-without-re-indexing-to-third-index/242359/1 "2020-07-23T14:54:16Z")

</div>

Assume i have indices with names carssdata\_original, carssdata\_stage

The data in the carsspark\_original is given below.  
{  
"\_index": "carssdata\_original",  
"\_type": "doc",  
"\_score": 1,  
"\_source": {  
"carid": "1",  
"carname": "BMW1",  
"enginetype": "Petrol",  
"cost": "20000",  
"countryId": "1",  
"modelnumber": "10"  
}  
}

The data in the carsspark\_stage is given below.  
{  
"\_index": "carssdata\_stage",  
"\_type": "doc",  
"\_score": 1,  
"\_source": {  
"carid": "2",  
"carname": "BMW2",  
"enginetype": "Petrol",  
"cost": "20000",  
"countryId": "1",  
"modelnumber": "10"  
}  
}

**With Re-Indexing:**  
POST \_reindex  
{  
"source": {  
"index": ["carssdata\_original", "carssdata\_stage"]  
},  
"dest": {  
"index": "carsspark\_final"  
}  
}

The data in the carsspark\_final is given below.

{  
"\_index": "carssdata\_original",  
"\_type": "doc",  
"\_score": 1,  
"\_source": {  
"carid": "1",  
"carname": "BMW1",  
"enginetype": "Petrol",  
"cost": "20000",  
"countryId": "1",  
"modelnumber": "10"  
}  
}  
{  
"\_index": "carssdata\_stage",  
"\_type": "doc",  
"\_score": 1,  
"\_source": {  
"carid": "2",  
"carname": "BMW2",  
"enginetype": "Petrol",  
"cost": "20000",  
"countryId": "1",  
"modelnumber": "10"  
}  
}

Which is expected.

But my requirement is not to create one more index by combining 2-indexes data into 3rd index, rather i would want to merge or copy carssdata\_stage data to carssdata\_original index. Once data copied later i can delete carssdata\_stage index. So that i can have only one index which is having both the data in single index.

Could you please help me on this.

---

<div class="post-metadata">

**Author:** ![dillibabu.mekala](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dillibabu.mekala](https://discuss.elastic.co/u/dillibabu.mekala)\
**Post date:** [July 28, 2020, 12:57pm UTC](https://discuss.elastic.co/t/how-to-merge-2-index-data-in-to-one-of-the-two-self-indexes-without-re-indexing-to-third-index/242359/2 "2020-07-28T12:57:33Z")

</div>

@Team, Any idea or suggestions on this.

---

<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:** [August 25, 2020, 1:02pm UTC](https://discuss.elastic.co/t/how-to-merge-2-index-data-in-to-one-of-the-two-self-indexes-without-re-indexing-to-third-index/242359/3 "2020-08-25T13:02:02Z")

</div>

Closed on August 25, 2020, 1:02pm UTC

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