gpt4 book ai didi

elasticsearch - 如何获取文档的每个分片中的段数 Elasticsearch

转载 作者:行者123 更新时间:2023-12-02 22:45:58 25 4
gpt4 key购买 nike

有没有一种方法可以获取Elasticsearch群集的每个分片中的段数?

我确实查看过_cat / segments?v,但是我不确定生成块,因为我需要获取索引的段总数。

最佳答案

您可以使用带有分片级别详细信息的Index stats API来执行此操作

GET your_index/_stats?level=shards

你会得到:
  "indices": {
"your_index": {
"primaries": {
...
},
"total": {
...
},
"shards": {
"0": [
{
...
"segments": {
"count": 4, <--- here is your information
"memory_in_bytes": 107085,
"terms_memory_in_bytes": 78808,
"stored_fields_memory_in_bytes": 1256,
"term_vectors_memory_in_bytes": 0,
"norms_memory_in_bytes": 8256,
"points_memory_in_bytes": 749,
"doc_values_memory_in_bytes": 18016,
"index_writer_memory_in_bytes": 0,
"version_map_memory_in_bytes": 0,
"fixed_bit_set_memory_in_bytes": 216,
"max_unsafe_auto_id_timestamp": -1,
"file_sizes": {}
},

另外,您也可以使用 Index segments API:
GET your_index/_segments

你会得到:
  "indices": {
"your_index": {
"shards": {
"0": [
{
"routing": {
"state": "STARTED",
"primary": true,
"node": "8Gql5xv_T7C8oXtPsWb4pQ"
},
"num_committed_segments": 4, <--- here is your information
"num_search_segments": 4,
"segments": {
"_15x": {
...

关于elasticsearch - 如何获取文档的每个分片中的段数 Elasticsearch ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50945160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com