/**
* 判断一个索引是否存在
* @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-08-11 16:47:34 发布
本文介绍了一个用于检查Elasticsearch中指定索引是否存在的方法。通过使用Rest High Level Client发起请求并接收响应,此方法能够有效地确定目标索引的存在状态。
942

被折叠的 条评论
为什么被折叠?



