Elasticsearch5.x 创建映射时报错PUT /shirts
{
"mappings": {
"item": {
"_id":{"path": "color"},
"properties": {
"brand": { "type": "keyword"},
"color": { "type": "keyword"},
"model": { "type": "keyword"}
}
}
}
}
错误如下;
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "_id is not configurable"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [item]: _id is not configurable",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "_id is not configurable"
}
},
"status": 400
}
请问下es5.x怎么制定_id引用一个filed呢?
{
"mappings": {
"item": {
"_id":{"path": "color"},
"properties": {
"brand": { "type": "keyword"},
"color": { "type": "keyword"},
"model": { "type": "keyword"}
}
}
}
}
错误如下;
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "_id is not configurable"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [item]: _id is not configurable",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "_id is not configurable"
}
},
"status": 400
}
请问下es5.x怎么制定_id引用一个filed呢?
2 个回复
novia - 1&0
赞同来自:
1.7版本支持
2以上版本貌似已经不支持了,最后在入库的时候自定义_id吧
Jea - 一只猿
赞同来自: