# How update with groovy script will work if change refresh interval

**URL:** <https://discuss.elastic.co/t/how-update-with-groovy-script-will-work-if-change-refresh-interval/36976>\
**Category:** Elasticsearch\
**Created:** [December 11, 2015, 12:16pm UTC](https://discuss.elastic.co/t/how-update-with-groovy-script-will-work-if-change-refresh-interval/36976 "2015-12-11T12:16:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Just](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Max\_Just](https://discuss.elastic.co/u/Max_Just)\
**Post date:** [December 11, 2015, 12:16pm UTC](https://discuss.elastic.co/t/how-update-with-groovy-script-will-work-if-change-refresh-interval/36976/1 "2015-12-11T12:16:07Z")

</div>

Hi, If I set refresh interfal to 30s and will use groovy script for partically update my document based on values contained in previous upserted fields will it works correctly? Or valid field data will be avail for groovy script after 30s?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 11, 2015, 6:31pm UTC](https://discuss.elastic.co/t/how-update-with-groovy-script-will-work-if-change-refresh-interval/36976/2 "2015-12-11T18:31:25Z")

</div>

The changes are available immediately. You should probably avoid constantly updating the same object over and over again quickly as you'll end up with lots of tombstones in the index, but you won't lose any data by doing so.

Actually raising the refresh interval should help make fewer tombstones. But I'd still try to avoid constant updates.

---

<div class="post-metadata">

**Author:** ![Max\_Just](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@Max\_Just](https://discuss.elastic.co/u/Max_Just)\
**Post date:** [December 12, 2015, 2:26pm UTC](https://discuss.elastic.co/t/how-update-with-groovy-script-will-work-if-change-refresh-interval/36976/3 "2015-12-12T14:26:46Z")

</div>

How many tombstones I have between refresh? I index entire document via groovy script because before I need to understand is it document better than existing one and then I use each operation cross document fields in groovy script to index incoming document. I have about 1K indexing operations per second with refresh interval 30 seconds. is it normal?

---

<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:** [July 5, 2017, 11:31pm UTC](https://discuss.elastic.co/t/how-update-with-groovy-script-will-work-if-change-refresh-interval/36976/4 "2017-07-05T23:31:23Z")

</div>


