# Is merging index A and Index B, into and index C, is possible in elasticsearch 6.x?

**URL:** <https://discuss.elastic.co/t/is-merging-index-a-and-index-b-into-and-index-c-is-possible-in-elasticsearch-6-x/224522>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 21, 2020, 1:20pm UTC](https://discuss.elastic.co/t/is-merging-index-a-and-index-b-into-and-index-c-is-possible-in-elasticsearch-6-x/224522 "2020-03-21T13:20:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yotam\_Levy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yotam_levy/32/52198_2.png) [@Yotam\_Levy](https://discuss.elastic.co/u/Yotam_Levy)\
**Post date:** [March 21, 2020, 1:20pm UTC](https://discuss.elastic.co/t/is-merging-index-a-and-index-b-into-and-index-c-is-possible-in-elasticsearch-6-x/224522/1 "2020-03-21T13:20:04Z")

</div>

Hi Friends,  
I'm trying to merge two indices into one index without duplications of fields:  
for example, if I have Index A called "sponge":

> ```
> PUT /sponge/_doc/1
> {
> "doc_id" : "1",
> "account_name" : "squarepants",
> "something" : "one"
> }
> 
> ```

and an Index B called "bob"

> ```
> PUT /bob/_doc/2
> {
> "doc_id" : "2",
> "account_name" : "squarepants",
> "something_else" : "two"
> }
> 
> ```

and I wanna merge "sponge" and "bob", into Index C called "spongebob", and that will look like so:

> ```
> {
> "doc_id" : "3",
> "account_name" : "squarepants",
> "something" : "one"
> "something_else" : "two"
> }
> 
> ```

is it possible to somehow use \_reindex to make this merge possible? or maybe some other es api that I can use to reach this outcome?  
tnx a lot for any help and stay safe and at home these days:)

---

<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:** [April 18, 2020, 1:20pm UTC](https://discuss.elastic.co/t/is-merging-index-a-and-index-b-into-and-index-c-is-possible-in-elasticsearch-6-x/224522/2 "2020-04-18T13:20:08Z")

</div>

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