我在ElasticSearch(5.0)中需要所有文档(实际上只需要_id
),因此我使用scroll
逐个扫描了文档碎片。然后我发现通过两种方式获得的分片中的文档不相等:
curl -s "https://es_host/my-index/_cat/shards"
我的索引0 p已开始5326742 4.5gb x.x.x.x1数据-x.x.x.x1-9200
我的索引1 p开始12123287 13.3gb x.x.x.x2 data-x.x.x.x2-9200
我的索引2 p开始10780477 17.3gb x.x.x.x3数据-x.x.x.x3-9200
curl "https://es_host/my-index/arkvideo/_count?preference=_shards:0" && curl "https://es_host/my-index/_count?preference=_shards:1" && curl "https://es_host/my-index/_count?preference=_shards:2"
{“ count”:2289966,“ _ shards”:{“ total”:1,“ successful”:1,“ failed”:0}}
{“ count”:5209918,“ _ shards”:{“ total”:1,“ successful”:1,“ failed”:0}}}
{“ count”:4871656,“ _ shards”:{“ total”:1,“ successful”:1,“ failed”:0}}
有人可以告诉我为什么吗?