# Check if items need updating

**URL:** <https://discuss.elastic.co/t/check-if-items-need-updating/226114>\
**Category:** Elasticsearch\
**Created:** [April 1, 2020, 6:50pm UTC](https://discuss.elastic.co/t/check-if-items-need-updating/226114 "2020-04-01T18:50:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![permagne](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@permagne](https://discuss.elastic.co/u/permagne)\
**Post date:** [April 1, 2020, 6:50pm UTC](https://discuss.elastic.co/t/check-if-items-need-updating/226114/1 "2020-04-01T18:50:06Z")

</div>

Hi,  
Currently working on a scheduled batch import.  
The items that are being saved may or may not contain updated values.  
My question is if I should first get the documents by IDs and check if the items need updating, and then post if they do, or should I just post all documents? I guess 7 out of 10 times it will not contain updated values.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 1, 2020, 10:39pm UTC](https://discuss.elastic.co/t/check-if-items-need-updating/226114/2 "2020-04-01T22:39:12Z")

</div>

Updates in Elasticsearch are relatively expensive, so if you can reduce the number of documents sent to it then it'd make sense.

---

<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 29, 2020, 10:39pm UTC](https://discuss.elastic.co/t/check-if-items-need-updating/226114/3 "2020-04-29T22:39:13Z")

</div>

Closed on April 29, 2020, 10:39pm UTC

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