# Elasticsearch\[7.7\] Does not update data or takes time to update the data

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085>\
**Category:** Elasticsearch\
**Created:** [February 12, 2024, 3:04pm UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085 "2024-02-12T15:04:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akki\_Kulkarni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akki_kulkarni/32/131576_2.png) [@Akki\_Kulkarni](https://discuss.elastic.co/u/Akki_Kulkarni)\
**Post date:** [February 12, 2024, 3:04pm UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/1 "2024-02-12T15:04:20Z")

</div>

In my application, we are updating more than one document at a time for a index\_x. When queried for updated documents, it does not return updated data for few document, immediately. e.g. If I am updating 10 documents, 1 document update is not retrieved immediately but after 10 to 15 mins. It has been observed that, the missed data is updated after 10 or 15 mins. For index\_x, we have set refresh parameter as default i.e. 1s.  
I am using Elasticsearch JAVA repository to update the document. I am updating whole document instead of selected fields. I observed that though I have sent the query to update document, it has not updated till next day also. I checked in Kibana as well. It returns old data. Still the data shows old.

Below are the app configurations for app:

JAVA: 11  
Spring Boot: 2.7.11  
Spring Data Elasticsearch: 4.2.12  
Elasticsearch client - 7.12.1  
Elasticsearch version on AWS - 7.7

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 12, 2024, 4:33pm UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/2 "2024-02-12T16:33:33Z")

</div>

Welcome!

> [@Akki\_Kulkarni](#):
>
> When queried for updated documents, it does not return updated data for few document

That's the expected behavior if you are not refreshing the index ([refresh API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html)).

---

<div class="post-metadata">

**Author:** ![Akki\_Kulkarni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akki_kulkarni/32/131576_2.png) [@Akki\_Kulkarni](https://discuss.elastic.co/u/Akki_Kulkarni)\
**Post date:** [February 13, 2024, 11:36am UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/3 "2024-02-13T11:36:06Z")

</div>

Thank you for the quick response. Though I am not refreshing the index manually, it should get refreshed in 1s as per the refresh\_interval(set to 1s). What about the document which were not at all get updated even after 2 days? I tried to run refresh API for my index but it seems the update it-self is not executed as I am not getting updated data after refresh API or even after 2 days.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 13, 2024, 1:23pm UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/4 "2024-02-13T13:23:25Z")

</div>

If you ran a refresh on the index you are searching on and the document has not been updated, this is most likely because the update did not work for that document. You should see a reject somewhere.

BTW you are using a version which is too old. Please update to 7.17.18.

---

<div class="post-metadata">

**Author:** ![Akki\_Kulkarni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akki_kulkarni/32/131576_2.png) [@Akki\_Kulkarni](https://discuss.elastic.co/u/Akki_Kulkarni)\
**Post date:** [February 13, 2024, 1:32pm UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/5 "2024-02-13T13:32:26Z")

</div>

Where I can see this rejection? At least I couldn't see that in app log. Do I need to check in Elasticsearch log? or in Kibana? Also if you could let me know the sample response for reject update that would be helpful.  
And yes we planning for upgrade in this year.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 13, 2024, 3:03pm UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/6 "2024-02-13T15:03:23Z")

</div>

Somewhere in your code...  
How are you running the update?

---

<div class="post-metadata">

**Author:** ![Akki\_Kulkarni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akki_kulkarni/32/131576_2.png) [@Akki\_Kulkarni](https://discuss.elastic.co/u/Akki_Kulkarni)\
**Post date:** [February 14, 2024, 5:21am UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/7 "2024-02-14T05:21:42Z")

</div>

I am using ElasticsearchRepository.saveAll(document).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 14, 2024, 8:30am UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/8 "2024-02-14T08:30:27Z")

</div>

Are you checking the result? I don't see your code here. So it would help if you share more.  
Anyway, `ElasticsearchRepository` is not a class made by Elastic but from Spring Data project.

I don't know if/how you can add more logs but this is something you probably need to check.

Some advices though:

- Upgrade Elasticsearch client to 7.17.18
- Check if upgrades are available for Spring data elasticsearch
- If possible move to the new Elasticsearch Java API Client.

What I can tell:

If the response does not show any rejection, if no exception is thrown, and if the code actually send a new version of the document, the document will be immediately visible if you run a [GET by id](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html) (whatever the refresh is).

---

<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:** [March 13, 2024, 8:31am UTC](https://discuss.elastic.co/t/elasticsearch-7-7-does-not-update-data-or-takes-time-to-update-the-data/353085/9 "2024-03-13T08:31:21Z")

</div>

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