尝试更新服务器上的u映射时遇到问题。我需要在 map 上添加一些字段。在这个问题上,我指望您的帮助。
我正在尝试更新 map :
curl -XGET http://x.xxx.xx.xx:9200/allek/_mapping/auctions?pretty
{
"allek" : {
"mappings" : {
"auctions" : {
"_all" : {
"enabled" : false
},
"properties" : {
"cat" : {
"type" : "long",
"store" : true
},
"curr" : {
"type" : "string",
"index" : "not_analyzed",
"store" : true
},
"end_date" : {
"type" : "long",
"store" : true
},
"price" : {
"type" : "long",
"store" : true
},
"start_date" : {
"type" : "long",
"store" : true
},
"tcat" : {
"type" : "long",
"store" : true
},
"title" : {
"type" : "string",
"store" : true
},
"uid" : {
"type" : "long",
"store" : true
}
}
}
}
}
吨 map :
{
"_all": {
"enabled": false
},
"properties": {
"cat": {
"store": true,
"type": "long",
"doc_values": true
},
"curr": {
"index": "not_analyzed",
"store": true,
"type": "string",
"doc_values": true
},
"end_date": {
"store": true,
"type": "long",
"doc_values": true
},
"price": {
"store": true,
"type": "long",
"doc_values": true
},
"start_date": {
"store": true,
"type": "long",
"doc_values": true
},
"tcat": {
"store": true,
"type": "long",
"doc_values": true
},
"title": {
"store": true,
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256,
"doc_values": true
}
}
},
"uid": {
"store": true,
"type": "long",
"doc_values": true
}
}
}
但是我得到消息:
{"error":"MergeMappingException[Merge failed with failures {[mapper [uid] has di
fferent doc_values values, mapper [end_date] has different doc_values values, ma
pper [cat] has different doc_values values, mapper [start_date] has different do
c_values values, mapper [curr] has different doc_values values, mapper [price] h
as different doc_values values, mapper [tcat] has different doc_values values]}]
","status":400}
我究竟做错了什么 ?
为了能够执行此操作,我必须重新索引数据并删除旧 map 并仅添加新 map ?
最佳答案
由于doc_values默认为false,因此在更新中将其设置为true时,会与现有映射产生冲突。
您唯一的选择是重新索引。
关于elasticsearch - 错误MergeMappingExcemption失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38122118/