亲,只收二进制

请问 RestHighLevelClient 怎么获取特定索引的大小

Elasticsearch | 作者 liu_lanyu | 发布于2020年11月18日 | 阅读数:3338


es7.9

IndicesStatsResponse stats = client.admin().indices().prepareStats() .clear().setTypes("a") .setStore(true) .execute().actionGet(); Map<String,IndexStats> indexStatsMap = stats.getIndices(); for(String indexName : indexNames){ if(!indexName.startsWith("a") || indexName.equals(curIndiceName)) continue; long size = indexStatsMap.get(indexName).getTotal().getStore().getSize().getBytes()/1024;
 
微信截图_20201118111235.png
已邀请:

FFFrp

赞同来自: liu_lanyu

目前好像没有看到文档有这个API,目前可以使用Low Level REST Client 获取 https://elasticsearch.cn/question/10695

要回复问题请先登录注册