# How to delete multiple fields with the same name when Reindexing

**URL:** <https://discuss.elastic.co/t/how-to-delete-multiple-fields-with-the-same-name-when-reindexing/290691>\
**Category:** Elasticsearch\
**Tags:** painless, reindex\
**Created:** [December 1, 2021, 4:03pm UTC](https://discuss.elastic.co/t/how-to-delete-multiple-fields-with-the-same-name-when-reindexing/290691 "2021-12-01T16:03:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hNiven](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hniven/32/94305_2.png) [@hNiven](https://discuss.elastic.co/u/hNiven)\
**Post date:** [December 1, 2021, 4:03pm UTC](https://discuss.elastic.co/t/how-to-delete-multiple-fields-with-the-same-name-when-reindexing/290691/1 "2021-12-01T16:03:32Z")

</div>

Hi,

We have reached the maximum fields limit on an index and after doing some research it looks like the best way to get rid of the unneeded fields we need to reindex.

Specifically we have many fields called activity.info, activity.arguments, activity.input etc.

is there a way to delete all fields that contain activity at the start without having to manually type out the name of each specific one when doing the reindex?

---

<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:** [December 2, 2021, 12:02am UTC](https://discuss.elastic.co/t/how-to-delete-multiple-fields-with-the-same-name-when-reindexing/290691/2 "2021-12-02T00:02:37Z")

</div>

I am not sure if painless supports wildcards like `"script" : "ctx._source.remove('activity.*')"`.

You might be able to use [Reindex API | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/docs-reindex.html#reindex-with-an-ingest-pipeline) to drop those fields.

---

<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:** [December 30, 2021, 12:03am UTC](https://discuss.elastic.co/t/how-to-delete-multiple-fields-with-the-same-name-when-reindexing/290691/3 "2021-12-30T00:03:27Z")

</div>

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