# Update or delete document is better?

**URL:** https://discuss.elastic.co/t/update-or-delete-document-is-better/364219
**Category:** Elastic Search
**Created:** [August 1, 2024, 4:20pm UTC](https://discuss.elastic.co/t/update-or-delete-document-is-better/364219 "2024-08-01T16:20:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nguyen\_Tho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nguyen_tho/32/136464_2.png) [@Nguyen\_Tho](https://discuss.elastic.co/u/Nguyen_Tho)
#### Post date: [August 1, 2024, 4:20pm UTC](https://discuss.elastic.co/t/update-or-delete-document-is-better/364219/1 "2024-08-01T16:20:32Z")

</div>

Hi,  
i have some index in elasticsearch with hundred million record and i have a request that need to update a document. But some time my api update get time out.  
i think about it and have some idea that whenever i get the request update, i detele the old document that need to update and insert new document with new value, is that good or not.  
Thanks

---

<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: [August 1, 2024, 4:42pm UTC](https://discuss.elastic.co/t/update-or-delete-document-is-better/364219/2 "2024-08-01T16:42:34Z")

</div>

That is basically what an update does so I do not see the point in splitting it into 2 operations as that would be less efficient.

It would probably be better to try and figure out why you have requests that time out. Which version of Elasticsearch are you using? What is the size and specification of your cluster? How much data do you have in it? What is the average size of your documents? What load is the cluster under when you experience timeouts?

---

<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: [August 29, 2024, 4:43pm UTC](https://discuss.elastic.co/t/update-or-delete-document-is-better/364219/3 "2024-08-29T16:43:02Z")

</div>

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