今天需要获取segment的数量 但是翻遍了百度都找不到
最后是领导在programcreek中帮我找到的
IndicesStatsResponse stats = client.admin().indices().prepareStats(indexName).setSegments(true).get();
stats.getTotal().getSegments().getCount();
client是链接es的,这个网上很多自行百度
今天需要获取segment的数量 但是翻遍了百度都找不到
最后是领导在programcreek中帮我找到的
IndicesStatsResponse stats = client.admin().indices().prepareStats(indexName).setSegments(true).get();
stats.getTotal().getSegments().getCount();
client是链接es的,这个网上很多自行百度