use of org.elasticsearch.client.AdminClient 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