{
"mappings": {
"duser": {
"_routing": {
"required": true
}
}
}
}
curl -XPUT 127.0.0.1:9200/myroute/duser/1 -d '
{
"title": "No routing value provided"
}'
错误:
error":{"root_cause":[{"type":"routing_missing_exception","reason":"routing is required for [my_index2]/[my_type]/[2]","index":"my_index2"}],"type":"routing_missing_exception","reason":"routing is required for [my_index2]/[my_type]/[2]","index":"my_index2"},"status":400}
错误原因: 请求参数 需要加上 route
curl -XPUT 127.0.0.1:9200/myroute/duser/1?routing=1 -d '
{
"title": "No routing value provided"
}'
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-routing-field.html 官网