针对同一查询的不同Elasticsearch结果

 如痴如醉as_961 发布于 2023-01-08 17:25

我已经为Elasticsearch设置了1个集群á4个节点.每个索引的分片数:1; 每个索引的副本数:3

当我多次调用类似下面的简单查询时,我会得到不同的结果(不同的总命中数和不同的前10个文档):

http://localhost:9200/index_name/_search?q=term

每个碎片上有不同的数据?我想让所有碎片都是最新的.我能做什么?

这是/ _cluster/health的结果:

{
  "cluster_name" : "secret",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 4,
  "number_of_data_nodes" : 4,
  "active_primary_shards" : 24,
  "active_shards" : 96,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0
}

作为临时解决方案,我通过Ruby gem tire:ModelName.rebuild_index重建索引

但我需要一个长期的解决方案.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有