1
到non_analyzed我有以下映射文檔類型:無法更改映射ElasticSearch
GET my_index/my_doctype/_mapping
{
"my_index": {
"mappings": {
"my_doctype": {
"properties": {
"@timestamp": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
"@version": {
"type": "string"
},
"prod_id": {
"type": "string"
},
"host": {
"type": "string"
},
"message": {
"type": "string"
},
"path": {
"type": "string"
},
"img_path": {
"type": "string"
},
"tags": {
"type": "string"
}
}
}
}
}
}
我試圖從analyzed
到non_analyzed
所以我跑這個請求更改一些字段:
PUT my_index/_mapping/my_doctype
{
"properties": {
"prod_id": {
"type": "string",
"index": "not_analyzed"
},
"img_path": {
"type": "string",
"index": "not_analyzed"
}
}
}
但我收到以下錯誤:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Mapper for [img_path] conflicts with existing mapping in other types:\n[mapper [img_path] has different [index] values, mapper [img_path] has different [doc_values] values, cannot change from disabled to enabled, mapper [img_path] has different [analyzer], mapper [img_path] is used by multiple types. Set update_all_types to true to update [omit_norms] across all types., mapper [img_path] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [img_path] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]"
}
],
"type": "illegal_argument_exception",
"reason": "Mapper for [img_path] conflicts with existing mapping in other types:\n[mapper [img_path] has different [index] values, mapper [img_path] has different [doc_values] values, cannot change from disabled to enabled, mapper [img_path] has different [analyzer], mapper [img_path] is used by multiple types. Set update_all_types to true to update [omit_norms] across all types., mapper [img_path] is used by multiple types. Set update_all_types to true to update [search_analyzer] across all types., mapper [img_path] is used by multiple types. Set update_all_types to true to update [search_quote_analyzer] across all types.]"
},
"status": 400
}
何w將字段「prod_id」和「img_path」更改爲not_analyzed
感謝您的回答,如何進行重新索引?我首先使用logstash進行索引。 – MedAli
同樣,只需重新運行Logstash配置,它將填充新的/更新的索引 – Val
好的,謝謝!會做 – MedAli