# UPDATE existing index with reindex and pipeline

**URL:** <https://discuss.elastic.co/t/update-existing-index-with-reindex-and-pipeline/328227>\
**Category:** Elasticsearch\
**Created:** [March 22, 2023, 9:51am UTC](https://discuss.elastic.co/t/update-existing-index-with-reindex-and-pipeline/328227 "2023-03-22T09:51:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hben](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@hben](https://discuss.elastic.co/u/hben)\
**Post date:** [March 22, 2023, 9:51am UTC](https://discuss.elastic.co/t/update-existing-index-with-reindex-and-pipeline/328227/1 "2023-03-22T09:51:54Z")

</div>

Hi,

I have an index that our application is working with like a Relational table,  
so we insert and update documents in it.

now we want to make a structure change and add 3 fields and add data to those fields from a table in SQL Server, based on ID that we have in Elasticsearch like so:  
A\_ID (ES) -\> A\_ID (MSSQL) -\> take A\_Name from MSSQL and update A\_Name in ES.  
(something like this logic:  
`UPDATE es.index SET A_Name = mssql.A_Name WHERE A_ID = mssql.A_ID`)  
the same goes for other fields, we have the ID in ES and MSSQL and we want to update the Name in ES based on the value in MSSQL.

we thought about doing it using update\_by\_query but because it's a heavy process we though about doing it using \_reindex...

the issue is that \_reindex is INSERTing or REPLACEing documents,  
the question is if it's possible to build a pipeline that would make the \_reindex update those 3 fields without losing all other fields in each document?  
(assuming we would bring the ID and the Name from MSSQL to ES as an index)

We cannot use enrichment...

---

<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:** [April 19, 2023, 9:52am UTC](https://discuss.elastic.co/t/update-existing-index-with-reindex-and-pipeline/328227/2 "2023-04-19T09:52:45Z")

</div>

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