gpt4 book ai didi

elasticsearch - 文件计数不一致

转载 作者:行者123 更新时间:2023-12-03 02:02:56 26 4
gpt4 key购买 nike

嗨,我正在运行Elasticsearch 1.5.2

我在其中一个索引中索引了6,761,727个文档。

当我运行以下查询时...

GET myindex/mytype/_search
{
"size": 0
}

hits.total总数保持2个值之间的交替...
"hits": {
"total": 6761727,
"max_score": 0,
"hits": []
}


"hits": {
"total": 6760368,
"max_score": 0,
"hits": []
}

无论我运行查询多少次,计数都会在2之间来回移动。

我四处搜寻,发现主分片与副本分片似乎没有相同数量的文档。如果我使用preference = primary,那么返回的文档数是正确的。

检查罪魁祸首是哪个分片并尝试对其进行修复而不重新索引所有内容的最简单方法是什么?

最佳答案

将该索引的副本计数设置为0

PUT /my_index/_settings
{
"index": {
"number_of_replicas": 0
}
}

等到执行 GET /_cat/shards/my_index?v并再设置回初始副本数时,再看不到该索引的更多副本。

这将删除该索引的所有副本,然后为主副本创建一个新副本。

关于elasticsearch - 文件计数不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30107302/

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