# After migrating to elasticsearch 6.7 create index, exist index API's of JAVA REST HIGH API were deprecated

**URL:** https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337
**Category:** Elasticsearch
**Created:** [March 28, 2019, 12:53pm UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337 "2019-03-28T12:53:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Harsha\_Yerasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harsha_yerasi/32/42985_2.png) [@Harsha\_Yerasi](https://discuss.elastic.co/u/Harsha_Yerasi)
#### Post date: [March 28, 2019, 12:53pm UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337/1 "2019-03-28T12:53:15Z")

</div>

Hi,

I have just migrated from elasticsearch 6.6 to 6.7.

I have created my index using the below guide.

[https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.7/java-rest-high-create-index.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.7/java-rest-high-create-index.html)

But the create method is showing me as deprecated. But it is not shown as deprecated in the guide.

![image](https://us1.discourse-cdn.com/elastic/original/3X/f/a/fabb7a0e71459588edaba18d52937821637cf1d5.png)

Which is the correct method to use?

Any help here.

Thanks,  
HarshaYerasi.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [March 28, 2019, 1:15pm UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337/2 "2019-03-28T13:15:43Z")

</div>

There's another `create()` method with a different request type, `org.elasticsearch.client.indices.CreateIndexRequest`, that you should use instead. This is mentioned in the `@deprecated` Javadocs.

---

<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: [March 28, 2019, 1:19pm UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337/3 "2019-03-28T13:19:16Z")

</div>

Basically change your import:

```auto
import org.elasticsearch.client.indices.CreateIndexRequest;

```

---

<div class="post-metadata">

### Author: ![Harsha\_Yerasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harsha_yerasi/32/42985_2.png) [@Harsha\_Yerasi](https://discuss.elastic.co/u/Harsha_Yerasi)
#### Post date: [March 29, 2019, 4:51am UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337/4 "2019-03-29T04:51:47Z")

</div>

Thank you,  
The problem is solved.

---

<div class="post-metadata">

### Author: ![Harsha\_Yerasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harsha_yerasi/32/42985_2.png) [@Harsha\_Yerasi](https://discuss.elastic.co/u/Harsha_Yerasi)
#### Post date: [March 29, 2019, 4:52am UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337/5 "2019-03-29T04:52:22Z")

</div>

Thank you.  
It solved the problem.

---

<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: [April 26, 2019, 4:52am UTC](https://discuss.elastic.co/t/after-migrating-to-elasticsearch-6-7-create-index-exist-index-apis-of-java-rest-high-api-were-deprecated/174337/6 "2019-04-26T04:52:29Z")

</div>

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