我已为我的 Elasticsearch(ES) 映射明确禁用路由:
{
"chow-clfg": {
"_parent": {
"type": "chow-demo"
},
"_routing": {
"required": false
},
"_id": {
"path": "clfg"
},
"dynamic": "true",
"_ttl": {
"enabled": true,
"default": "1h"
},
"properties": {
"clfg": {
"analyzer": "keyword",
"type": "string"
},
"@timestamp": {
"format": "dateOptionalTime",
"type": "date"
},
"count": {
"type": "long"
}
}
}
}
在执行 curl 命令删除和更新新映射后,当我执行 _cluster/state 命令时,我仍然启用了路由:
"mappings" : {
"chow-clfg" : {
"_id" : {
"path" : "clfg"
},
"_routing" : {
"required" : true
},
"_ttl" : {
"enabled" : true,
"default" : 3600000
},
"properties" : {
"@timestamp" : {
"format" : "dateOptionalTime",
"type" : "date"
},
"clfg" : {
"analyzer" : "keyword",
"type" : "string"
},
"count" : {
"type" : "long"
}
},
"_parent" : {
"type" : "chow-demo"
}
}
所以它给我留下了以下问题:
- 如果在父/子映射中没有必要要求,我如何禁用路由?
- 如果需要路由,是否可以在不唯一的字段上进行路由?