7
试图Elasticsearch 2下创建映射使用下面的命令,但它失败:Elasticsearch测绘工作不
POST /my_blog
{
"settings": {
"index" : {
"number_of_shards" : 10
}
},
"mappings": {
"post" : {
"_routing" : {
"required": false,
"path" : "post_date"
},
"properties": {
"user_id" :{
"type": "integer"
},
"post_text" : {
"type": "string"
},
"post_date": {
"type" : "date",
"format" : "YYYY-MM-DD"
}
}
}
}
}
响应:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [_routing] has unsupported parameters: [path : post_date]"
}
],
"type": "mapper_parsing_exception",
"reason": "mapping [post]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [_routing] has unsupported parameters: [path : post_date]"
}
},
"status": 400
}
不要紧,我选择什么领域的路径,整数/字符串或日期,它总是给出相同的错误答复(见上文)。有任何想法吗?
谢谢,我要一看。 –
实际上,如果你打算将'routing'标记为不需要的,那么你可以把这个子句放在外面,据我所知。 –