小编Ale*_*yak的帖子

_stats与_count返回的弹性搜索文档计数

我正在尝试获取弹性搜索集群中的索引的统计数据/计数(1.2.1).我使用Indices Stats API(_stats端点)来获取主文档的总数及其在磁盘上的大小.但是,我开始尝试使用Count API(_count端点)并注意到值不对齐.

这些值有什么区别?虽然文档中的线索表明刷新索引时Indicies Stats返回的值可能会发生变化,但文档中并未完全清楚.这让我想知道这是否是Lucene层的低级值.

指数统计API

localhost:9200/my_index/_stats

...snip...

"_all" : {
  "primaries" : {
    "docs" : {
      "count" : 8284,
      "deleted" : 87
    },
  }
}

...snip...
Run Code Online (Sandbox Code Playgroud)

计算API

localhost:9200/my_index/_count

{
  "count" : 6854,
  "_shards" : {
    "total" : 40,
    "successful" : 40,
    "failed" : 0
  }
}
Run Code Online (Sandbox Code Playgroud)

database rest nosql elasticsearch

9
推荐指数
1
解决办法
3206
查看次数

标签 统计

database ×1

elasticsearch ×1

nosql ×1

rest ×1