2015-10-14 42 views
0

我知道_stats API提供了一个或多个索引的索引级别统计信息。我对store参数特别感兴趣,它是以字节为单位的索引大小。我想计算的字节大小为索引中的给定类型,但是我如何计算弹性搜索索引内给定类型的统计信息

curl http://localhost:9200/myIndex/_stats/indexing?types=myType

字节不会返回大小myType。是否有一个API会给我的统计数据,会陈述:myType是Xgb的大小,并代表myIndexY%?

回答

0

您需要使用/store子路径,而不是像这样/indexing副路径:

curl http://localhost:9200/myIndex/_stats/store?types=myType 
              ^
              | 
            use "store" here 

,你会得到在

{ 
    "_shards" : { 
    "total" : 15, 
    "successful" : 15, 
    "failed" : 0 
    }, 
    "_all" : { 
    "primaries" : { 
     "store" : { 
     "size_in_bytes" : 2250058413, 
     "throttle_time_in_millis" : 0 
     } 
    }, 
    "total" : { 
     "store" : { 
     "size_in_bytes" : 2250058413, 
     "throttle_time_in_millis" : 0 
     } 
    } 
    }, 
    "indices" : { 
    "myIndex" : { 
     "primaries" : { 
     "store" : { 
      "size_in_bytes" : 1444291, 
      "throttle_time_in_millis" : 0 
     } 
     }, 
     "total" : { 
     "store" : { 
      "size_in_bytes" : 1444291, 
      "throttle_time_in_millis" : 0 
     } 
     } 
    }, 
    ... 
    } 
} 
0
所有 store数据你有兴趣

以上仅适用于索引。您正在指定类型,但您仍然可以看到所有类型的商店。