0
使用文档中建议的fake index per user。 ES版本1.6.0有时无法按预期运行。elasticsearch伪造每个用户的索引 - 更新时如何推断路由值?
检查别名:
curl localhost:9200/testbig/_alias/<userId>
{"<indexname>":{"aliases":{"<userId>":{"filter":{"term":
{"userId":"<userId>"}},"index_routing":"<userId>","search_routing":"<userId>"}}
}}
但试图更新文档:
curl -XPOST localhost:9200/<userId>/<type>/<id>/_update -d
'{"doc":{"userId":"<userId>","field1":"val1"}}'
我得到
{ "error": "ElasticsearchIllegalArgumentException[Alias [<userId>] has
index routing associated with it [<userId>], and was provided with
routing value [<DIFFERENTuserId>], rejecting operation]",
"status": 400 }
您是否已在映射中启用路由并将其指向特定字段? –