/**
* 判断一个索引是否存在
* @param indexName
* @return
*/
private boolean isExistsIndex(String indexName){
GetIndexRequest request = new GetIndexRequest();
try {
boolean exists = restHighLevelClient.indices().exists(request.indices(indexName), RequestOptions.DEFAULT);
return exists;
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
ES7中restHighLevelClient判断一个索引是否存在
最新推荐文章于 2024-03-27 10:27:35 发布