# Fill an Elasticsearch index with data from another index on same cluster

**URL:** <https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451>\
**Category:** Elasticsearch\
**Created:** [April 7, 2021, 11:39am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451 "2021-04-07T11:39:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![workaround](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workaround/32/48152_2.png) [@workaround](https://discuss.elastic.co/u/workaround)\
**Post date:** [April 7, 2021, 11:39am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/1 "2021-04-07T11:39:16Z")

</div>

_This is kind of a noob question so please be kind._

I have an elasticsearch cluster (v5) with 3 nodes and two indexes, lets say indexes X and Y(default). I would like to know if there is a way to write data to the index X and automatically write data to index Y. Is there something built in to ES, for doinf so?

I have read about ES mappings, however I am not sure I understand the concept and if this is the way to go.

I have read about watches and triggers, but I think they are only available in paid versions.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [April 7, 2021, 12:48pm UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/2 "2021-04-07T12:48:59Z")

</div>

You can "reindex" data with:

> **[Reindex API | Elasticsearch Guide \[7.12\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)**

---

<div class="post-metadata">

**Author:** ![workaround](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workaround/32/48152_2.png) [@workaround](https://discuss.elastic.co/u/workaround)\
**Post date:** [April 7, 2021, 5:02pm UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/3 "2021-04-07T17:02:44Z")

</div>

Thanks! Is there a way I can set it up everytime I put data to one of the two indexes?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 8, 2021, 12:21am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/4 "2021-04-08T00:21:52Z")

</div>

No there's not sorry.

---

<div class="post-metadata">

**Author:** ![ebuildy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebuildy/32/6070_2.png) [@ebuildy](https://discuss.elastic.co/u/ebuildy)\
**Post date:** [April 8, 2021, 6:46am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/5 "2021-04-08T06:46:43Z")

</div>

No with this API.

Also there is Cross Cluster Replication that could be interesting [Cross-cluster replication | Elasticsearch Guide [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-ccr.html) .

Maybe with ingestion pipeline, you could do that, I am not sure.

---

<div class="post-metadata">

**Author:** ![workaround](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workaround/32/48152_2.png) [@workaround](https://discuss.elastic.co/u/workaround)\
**Post date:** [April 8, 2021, 8:30am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/6 "2021-04-08T08:30:02Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![workaround](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workaround/32/48152_2.png) [@workaround](https://discuss.elastic.co/u/workaround)\
**Post date:** [April 8, 2021, 8:30am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/7 "2021-04-08T08:30:18Z")

</div>

Ok thanks a lot for the info!

---

<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 6, 2021, 8:30am UTC](https://discuss.elastic.co/t/fill-an-elasticsearch-index-with-data-from-another-index-on-same-cluster/269451/8 "2021-05-06T08:30:50Z")

</div>

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