# Issue with Elasticsearch 6.4 refresh policy on IndexRequest

**URL:** <https://discuss.elastic.co/t/issue-with-elasticsearch-6-4-refresh-policy-on-indexrequest/148746>\
**Category:** Elasticsearch\
**Created:** [September 16, 2018, 8:42pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-6-4-refresh-policy-on-indexrequest/148746 "2018-09-16T20:42:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbalaguero](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@jbalaguero](https://discuss.elastic.co/u/jbalaguero)\
**Post date:** [September 16, 2018, 8:42pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-6-4-refresh-policy-on-indexrequest/148746/1 "2018-09-16T20:42:20Z")

</div>

Hello,

I'm indexing an ES 6.4 index in this way:

```
cluster.getRestClient().index(new IndexRequest(INDEX_NAME, TYPE_NAME, cacheId).source(objCache.getIndexDocument(), XContentType.JSON), cluster.getRequestOptions());

```

This works perfectly. But when I add the refresh policy:

```
cluster.getRestClient().index(new IndexRequest(INDEX_NAME, TYPE_NAME, cacheId).source(objCache.getIndexDocument(), XContentType.JSON).setRefreshPolicy(RefreshPolicy.WAIT_UNTIL), cluster.getRequestOptions())

```

All threads get stuck. Our web application remains unresponsive and we have to shutdown tomcat 8.5.32. Not sure if this is a bug, or if this policy must not be used with an IndexRequest.

It's just 1 ES node with this index settings:  
"index.number\_of\_shards" = 1  
"index.number\_of\_replicas" = 0  
"index.refresh\_interval" = 10000  
cluster.getRequestOptions = RequestOptions.DEFAULT.toBuilder().build()

---

<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:** [October 14, 2018, 8:42pm UTC](https://discuss.elastic.co/t/issue-with-elasticsearch-6-4-refresh-policy-on-indexrequest/148746/2 "2018-10-14T20:42:22Z")

</div>

Closed on October 14, 2018, 8:42pm UTC

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