# Latency in indexing using client.update() of the high level rest client

**URL:** <https://discuss.elastic.co/t/latency-in-indexing-using-client-update-of-the-high-level-rest-client/269142>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 3, 2021, 6:09am UTC](https://discuss.elastic.co/t/latency-in-indexing-using-client-update-of-the-high-level-rest-client/269142 "2021-04-03T06:09:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh\_H\_Viraktamath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahesh_h_viraktamath/32/37044_2.png) [@Mahesh\_H\_Viraktamath](https://discuss.elastic.co/u/Mahesh_H_Viraktamath)\
**Post date:** [April 3, 2021, 6:09am UTC](https://discuss.elastic.co/t/latency-in-indexing-using-client-update-of-the-high-level-rest-client/269142/1 "2021-04-03T06:09:32Z")

</div>

We have started using the high level REST client finally, to ease the development of queries from backend engineering perspective. For indexing, we are using the client.update(request, RequestOptions.DEFAULT) so that new documents will be created and existing ones modified.

The issue that we are seeing is, the indexing is delayed, almost by 5 minutes. I see that they use async http calls internally. But that should not take so long, I looked for some timing options inside the library, didn't find anything. Am I missing anything or the official documentation is missing for this?

---

<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:** [April 3, 2021, 8:12am UTC](https://discuss.elastic.co/t/latency-in-indexing-using-client-update-of-the-high-level-rest-client/269142/2 "2021-04-03T08:12:17Z")

</div>

Use:

```
client.index(request, RequestOptions.DEFAULT);

```

Or better the bulk api (look at the bulk processor).  
An example at:

[https://github.com/dadoonet/legacy-search/blob/02-bulk/src/main/java/fr/pilato/demo/legacysearch/dao/ElasticsearchDao.java#L71](https://github.com/dadoonet/legacy-search/blob/02-bulk/src/main/java/fr/pilato/demo/legacysearch/dao/ElasticsearchDao.java#L71)

> The issue that we are seeing is, the indexing is delayed, almost by 5 minutes.

How do you know that?

---

<div class="post-metadata">

**Author:** ![Mahesh\_H\_Viraktamath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahesh_h_viraktamath/32/37044_2.png) [@Mahesh\_H\_Viraktamath](https://discuss.elastic.co/u/Mahesh_H_Viraktamath)\
**Post date:** [April 3, 2021, 10:13am UTC](https://discuss.elastic.co/t/latency-in-indexing-using-client-update-of-the-high-level-rest-client/269142/3 "2021-04-03T10:13:54Z")

</div>

We see the updates happening, but after 5 minutes. Finally, after setting the `refresh_interval` to 1s, the updates are faster now. Do you think. client.index() would be faster?

---

<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:** [May 1, 2021, 10:14am UTC](https://discuss.elastic.co/t/latency-in-indexing-using-client-update-of-the-high-level-rest-client/269142/4 "2021-05-01T10:14:05Z")

</div>

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