use of org.elasticsearch.client.IndicesAdminClient in project fess by codelibs.
the class AdminUpgradeAction method upgradeFromAll.
private void upgradeFromAll() {
final IndicesAdminClient indicesClient = fessEsClient.admin().indices();
final String crawlerIndex = fessConfig.getIndexDocumentCrawlerIndex();
// .crawler
if (existsIndex(indicesClient, crawlerIndex, IndicesOptions.fromOptions(false, true, true, true))) {
deleteIndex(indicesClient, crawlerIndex, response -> {
});
}
}
use of org.elasticsearch.client.IndicesAdminClient in project play2-elasticsearch by cleverage.
the class IndexService method existsIndex.
/**
* Test if an indice Exists
* @return true if exists
*/
public static boolean existsIndex(String indexName) {
Client client = IndexClient.client;
AdminClient admin = client.admin();
IndicesAdminClient indices = admin.indices();
IndicesExistsRequestBuilder indicesExistsRequestBuilder = indices.prepareExists(indexName);
IndicesExistsResponse response = indicesExistsRequestBuilder.execute().actionGet();
return response.isExists();
}
Aggregations