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

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

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

image

Which is the correct method to use?

Any help here.

Thanks,
HarshaYerasi.

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.

Basically change your import:

import org.elasticsearch.client.indices.CreateIndexRequest;

Thank you,
The problem is solved.

Thank you.
It solved the problem.