当使用anaylzer
将PUT /job/_mapping/doc/
放入映射时,却发生冲突。
但是映射中没有anaylzer
。
PUT /job/_mapping/doc/
{
"properties":{
"title": {
"type": "text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart"
}
}
}
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Mapper for [title] conflicts with existing mapping in other types:\n[mapper [title] has different [analyzer]]"
}
],
"type": "illegal_argument_exception",
"reason": "Mapper for [title] conflicts with existing mapping in other types:\n[mapper [title] has different [analyzer]]"
},
"status": 400
}
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"fielddata": true
},
输出配置是这样的。output {
elasticsearch {
hosts => ["<Elasticsearch Hosts>"]
user => "<user>"
password => "<password>"
index => "<table>"
document_id => "%{<MySQL_PRIMARY_KEY>}"
}
}
最佳答案
您无法在elasticsearch
中更新映射,可以添加映射,但不能更新映射。 Elasticsearch在索引编制时使用映射,这就是为什么您无法更新现有字段的映射的原因。 Analyzer是映射的一部分,实际上,如果您未指定默认值,则Analyzer会告诉Elastic如何索引文档。
关于elasticsearch - 无法在Elasticsearch中更新映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55028438/