# IndexResponse.isCreated() deprecated in v5.x

**URL:** <https://discuss.elastic.co/t/indexresponse-iscreated-deprecated-in-v5-x/176198>\
**Category:** Elasticsearch\
**Created:** [April 10, 2019, 11:13am UTC](https://discuss.elastic.co/t/indexresponse-iscreated-deprecated-in-v5-x/176198 "2019-04-10T11:13:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@utkarsh](https://discuss.elastic.co/u/utkarsh)\
**Post date:** [April 10, 2019, 11:13am UTC](https://discuss.elastic.co/t/indexresponse-iscreated-deprecated-in-v5-x/176198/1 "2019-04-10T11:13:39Z")

</div>

I am currently upgrading the ES to v5.6.2 from 2.3.3. I am facing the issue: cannot resolve symbol isCreated() when the code tries to check whether the document was created/updated. Please find below the code-

IndexResponse response = indexRequestBuilder.setRefreshPolicy(Boolean.toString(refreshIndex)).execute().actionGet();  
if (response == null || !response.isCreated()) {// error: cannot resolve isCreated()  
throw new DaoRuntimeException(String.format("Unable to create a new document in ES. Index : %s/%s, id : %s, parentId : %s and source : %s", indexName, documentType, id, parentId, source));  
}

Please help.

---

<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 10, 2019, 11:45am UTC](https://discuss.elastic.co/t/indexresponse-iscreated-deprecated-in-v5-x/176198/2 "2019-04-10T11:45:48Z")

</div>

Look at:

> <https://github.com/elastic/elasticsearch/blob/5.6/core/src/main/java/org/elasticsearch/action/index/IndexResponse.java#L50-L53>

---

<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 8, 2019, 11:46am UTC](https://discuss.elastic.co/t/indexresponse-iscreated-deprecated-in-v5-x/176198/3 "2019-05-08T11:46:00Z")

</div>

Closed on May 8, 2019, 11:46am UTC

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