elasticseach 查询文档数量

curl 'localhost:9200/_cat/indices?v'

healthstatusindexprirepdocs.countdocs.deletedstore.sizepri.store.size
greenopen.kibana10103.1kb3.1kb
greenopeninfo501948510087.2mb87.2mb

使用这种方式,查询文档数量,是不准确的!

原因如下:(来自官方网站
We can tell quickly how many shards make up an index, the number of docs, deleted docs, primary store size, and total store size (all shards including replicas). All these exposed metrics come directly from Lucene APIs.

Notes:

As the number of documents and deleted documents shown in this are at the lucene level, it includes all the hidden documents (e.g. from nested documents) as well.
To get actual count of documents at the Elasticsearch level, the recommended way is to use either the cat count or the Count API

应该使用这种命令来查询数量
curl -X GET "localhost:9200/_cat/count?v"

epochtimestampcount
153239864902:17:298583295

查询某index的文档数量
curl -X GET "localhost:9200/_cat/count/index_name?v"

153239873902:18:596645550

The document count indicates the number of live documents and does not include deleted documents which have not yet been cleaned up by the merge process.

来自于官网

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值