Skip to content

Instantly share code, notes, and snippets.

@suresk
Created April 10, 2016 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suresk/ffc05117c36cd3cabc66be69f95f58c0 to your computer and use it in GitHub Desktop.
Save suresk/ffc05117c36cd3cabc66be69f95f58c0 to your computer and use it in GitHub Desktop.
Elasticsearch delete index if it exists
// 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