# Find and replace word in all documents in any field

**URL:** <https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393>\
**Category:** Elasticsearch\
**Created:** [May 7, 2021, 8:38am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393 "2021-05-07T08:38:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![simone.dicola](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@simone.dicola](https://discuss.elastic.co/u/simone.dicola)\
**Post date:** [May 7, 2021, 8:38am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393/1 "2021-05-07T08:38:13Z")

</div>

As per title, due to a bug in conversion library, we got more than 200k documents containing `&amp;` instead of `&`.  
Is there a query I can run to do a find and replace in any field?

Thanks

---

<div class="post-metadata">

**Author:** ![simone.dicola](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@simone.dicola](https://discuss.elastic.co/u/simone.dicola)\
**Post date:** [May 7, 2021, 9:14am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393/2 "2021-05-07T09:14:58Z")

</div>

I have opened a question in SO as well in case someone has the same question -\> [elasticsearch - Elastic: replace a word in all documents regardless of the field - Stack Overflow](https://stackoverflow.com/questions/67431359/elastic-replace-a-word-in-all-documents-regardless-of-the-field)

---

<div class="post-metadata">

**Author:** ![simone.dicola](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@simone.dicola](https://discuss.elastic.co/u/simone.dicola)\
**Post date:** [May 10, 2021, 7:42am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393/3 "2021-05-10T07:42:06Z")

</div>

Have I asked something completely naive or there is not a solution for this?

---

<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:** [May 10, 2021, 7:56am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393/4 "2021-05-10T07:56:19Z")

</div>

Welcome to our community! 😃

> [@simone.dicola](#):
>
> Have I asked something completely naive or there is not a solution for this?

You did ask pretty much right on the weekend, so I would just give it a bit more time 🙂

---

<div class="post-metadata">

**Author:** ![simone.dicola](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@simone.dicola](https://discuss.elastic.co/u/simone.dicola)\
**Post date:** [May 10, 2021, 11:52am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393/5 "2021-05-10T11:52:12Z")

</div>

ok 🙂

---

<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:** [June 7, 2021, 11:52am UTC](https://discuss.elastic.co/t/find-and-replace-word-in-all-documents-in-any-field/272393/6 "2021-06-07T11:52:38Z")

</div>

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