How to check if an index and mapping exists in elasticsearch v6.0.1

How to check if an index already exists before creating an index in elasticsearch. I could not find any documentation on this. Please help.

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html

Thank you for quick response. I am looking for Rest High Level Client java api.

https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.0/java-rest-high.html could you please let me know the documentation link.

It's not supported yet in the HLClient but it's trivial to implement. See https://github.com/dadoonet/fscrawler/blob/master/elasticsearch-client/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/ElasticsearchClient.java#L134

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