1
にnon_analyzedへのマッピングを変更することはできません:は、私は次のようなマッピングとDOCTYPEを持って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"
}
}
}
}
}
}
私は、私はこの要求を実行するnon_analyzed
に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
}
ホーフィールド "prod_id"と "img_path"をnot_analyzed
に変更する
回答をお寄せいただきありがとうございます。どのようにインデックスを再作成するのですか?私は最初にlogstashを使ってインデックスを作成しています。 – MedAli
同じように、Logstashの設定を再実行するだけで、新しい/更新されたインデックスが設定されます – Val
ありがとうございます!しましょう – MedAli