# Replace document vs update document

**URL:** <https://discuss.elastic.co/t/replace-document-vs-update-document/293549>\
**Category:** Elasticsearch\
**Created:** [January 5, 2022, 1:49pm UTC](https://discuss.elastic.co/t/replace-document-vs-update-document/293549 "2022-01-05T13:49:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AhmadHamouda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmadhamouda/32/99880_2.png) [@AhmadHamouda](https://discuss.elastic.co/u/AhmadHamouda)\
**Post date:** [January 5, 2022, 1:49pm UTC](https://discuss.elastic.co/t/replace-document-vs-update-document/293549/1 "2022-01-05T13:49:14Z")

</div>

Ill have documents which contain json ex: {id:100, usersIds: [1,2,54]}  
Ill need to update userIds adding some new ids and removing some exist ids  
My question is it better to replace the whole document or do update operation on the document?  
We are talking about document size 50MB and will have 70K doc on the cluster

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 5, 2022, 2:28pm UTC](https://discuss.elastic.co/t/replace-document-vs-update-document/293549/2 "2022-01-05T14:28:14Z")

</div>

I suspect it may make much difference as when you update a document in Elasticsearch the whole document is reindexed.

---

<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 2, 2022, 2:28pm UTC](https://discuss.elastic.co/t/replace-document-vs-update-document/293549/3 "2022-02-02T14:28:21Z")

</div>

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