# Modify the documents while reindexing

**URL:** <https://discuss.elastic.co/t/modify-the-documents-while-reindexing/115096>\
**Category:** Elasticsearch\
**Created:** [January 11, 2018, 1:41pm UTC](https://discuss.elastic.co/t/modify-the-documents-while-reindexing/115096 "2018-01-11T13:41:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishekh](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@Abhishekh](https://discuss.elastic.co/u/Abhishekh)\
**Post date:** [January 11, 2018, 1:41pm UTC](https://discuss.elastic.co/t/modify-the-documents-while-reindexing/115096/1 "2018-01-11T13:41:17Z")

</div>

Hi,  
Can we modify the documents while reindexing ? Example: Suppose a document at source index contains a field "user" = "gmail" and while reindexing from source to destination shall we change the "user" = "facebook" at destination index? or after reindex we have to update by separate update command?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2018, 2:43pm UTC](https://discuss.elastic.co/t/modify-the-documents-while-reindexing/115096/2 "2018-01-11T14:43:08Z")

</div>

You can provide a script while reindexing.  
See [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

---

<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:** [February 8, 2018, 2:43pm UTC](https://discuss.elastic.co/t/modify-the-documents-while-reindexing/115096/3 "2018-02-08T14:43:15Z")

</div>

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