# Update given indices by index template

**URL:** <https://discuss.elastic.co/t/update-given-indices-by-index-template/281645>\
**Category:** Elasticsearch\
**Created:** [August 17, 2021, 8:33am UTC](https://discuss.elastic.co/t/update-given-indices-by-index-template/281645 "2021-08-17T08:33:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rammi22](https://discuss.elastic.co/u/Rammi22)\
**Post date:** [August 17, 2021, 8:33am UTC](https://discuss.elastic.co/t/update-given-indices-by-index-template/281645/1 "2021-08-17T08:33:19Z")

</div>

Hi,

i've created a [`index_template`](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html).

There exist a lot of indices with more than 40 million documents. Is it possible update existing index by the template instaed to [`reindex`](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html) all?

The [`_update_by_query`](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html) doesn't do the job...

---

<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:** [August 17, 2021, 8:48am UTC](https://discuss.elastic.co/t/update-given-indices-by-index-template/281645/2 "2021-08-17T08:48:31Z")

</div>

You can reindex into a new index that matches the template, yes.

---

<div class="post-metadata">

**Author:** ![Rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rammi22](https://discuss.elastic.co/u/Rammi22)\
**Post date:** [August 17, 2021, 8:56am UTC](https://discuss.elastic.co/t/update-given-indices-by-index-template/281645/3 "2021-08-17T08:56:37Z")

</div>

Sorry there was an error in my question:

Is it possible **update existing indices** by the template _ **instead** _ to [`reindex`](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html) all

---

<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:** [August 17, 2021, 8:57am UTC](https://discuss.elastic.co/t/update-given-indices-by-index-template/281645/4 "2021-08-17T08:57:05Z")

</div>

No you cannot do that, it needs a reindex.

---

<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:** [September 14, 2021, 8:57am UTC](https://discuss.elastic.co/t/update-given-indices-by-index-template/281645/5 "2021-09-14T08:57:24Z")

</div>

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