我已经为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重建索引
但我需要一个长期的解决方案.