diff --git a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java index 9750f7a..79f8380 100644 --- a/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java +++ b/elx-common/src/main/java/org/xbib/elx/common/AbstractAdminClient.java @@ -49,6 +49,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; @@ -163,12 +164,16 @@ public abstract class AbstractAdminClient extends AbstractBasicClient implements return; } ensureClientIsPresent(); - DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest().indices(indexName); - AcknowledgedResponse acknowledgedResponse = client.execute(DeleteIndexAction.INSTANCE, deleteIndexRequest).actionGet(); - if (acknowledgedResponse.isAcknowledged()) { - logger.info("index " + indexName + " deleted"); + try { + DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest().indices(indexName); + AcknowledgedResponse acknowledgedResponse = client.execute(DeleteIndexAction.INSTANCE, deleteIndexRequest).actionGet(); + if (acknowledgedResponse.isAcknowledged()) { + logger.info("index " + indexName + " deleted"); + } + waitForHealthyCluster(); + } catch (IndexNotFoundException e) { + logger.log(Level.WARNING, "index " + indexName + " not found, skipping deletion"); } - waitForHealthyCluster(); } @Override diff --git a/gradle.properties b/gradle.properties index e05d576..9de806e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group = org.xbib name = elx -version = 7.10.2.30 +version = 7.10.2.31 org.gradle.warning.mode = ALL