作者:大瑞Y | 来源:互联网 | 2023-10-12 09:49
使用聚合搜索需要进行中文分词,所以考虑使用 ik_smart,分词
1 2 3 4 5 6 7 8 9 10
| PUT /job/_mapping/doc/
{
"properties":{
"title": {
"type": "text",
"analyzer":"ik_smart",
"search_analyzer":"ik_smart"
}
}
} |
但是添加不成功,
1 2 3 4 5 6 7 8 9 10 11 12 13
| {
"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
} |
然而查看字段并没有 anaylzer
1 2 3 4 5 6 7 8 9 10
| "title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"fielddata": true
}, |