# Update documents with reindex

**URL:** <https://discuss.elastic.co/t/update-documents-with-reindex/112874>\
**Category:** Elasticsearch\
**Created:** [December 21, 2017, 6:24pm UTC](https://discuss.elastic.co/t/update-documents-with-reindex/112874 "2017-12-21T18:24:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilisade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gilisade/32/98740_2.png) [@gilisade](https://discuss.elastic.co/u/gilisade)\
**Post date:** [December 21, 2017, 6:24pm UTC](https://discuss.elastic.co/t/update-documents-with-reindex/112874/1 "2017-12-21T18:24:48Z")

</div>

Hi all  
I have an index which contains the fields likes and reviews.  
We load the index using jdbc input with logstash.  
Every night we need to delete the index and reload it from the Oracle db.  
But we need to keep the fields mentioned above.  
So I tried reindexing these fields to a temporary index . Then deleteing the I main index. Reloading it with logstash .  
Then I tried to reindex back the fields of likes and reviews from the temporary index i've created.  
What happened is , it just did an overwrite to the whole document instead of just updating the fields of likes and reviews. Tried changing the version\_type to external , but it did not work .

Worth mentioning that the documents in the main index get updated so their version is usually higher than 1.

Using ES 5.3  
any ideas ?

---

<div class="post-metadata">

**Author:** ![luiz.santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luiz.santos/32/24664_2.png) [@luiz.santos](https://discuss.elastic.co/u/luiz.santos)\
**Post date:** [December 29, 2017, 12:14pm UTC](https://discuss.elastic.co/t/update-documents-with-reindex/112874/2 "2017-12-29T12:14:52Z")

</div>

Hi @gilisade,

You should use the [update API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html) to not overwrite the hole document.

I think another more straightforward solution would be to adjust the logstash elasticsearch output action to use [update](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-action).

Cheers,  
LG

---

<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:** [January 26, 2018, 12:15pm UTC](https://discuss.elastic.co/t/update-documents-with-reindex/112874/3 "2018-01-26T12:15:24Z")

</div>

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