Created
April 10, 2016 06:02
-
-
Save suresk/ffc05117c36cd3cabc66be69f95f58c0 to your computer and use it in GitHub Desktop.
Elasticsearch delete index if it exists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete it, if it already exists | |
if(elasticClient.admin().indices().exists(new IndicesExistsRequest(indexName)).actionGet().isExists()) | |
{ | |
elasticClient.admin().indices().delete(new DeleteIndexRequest(indexName)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment