【发布时间】:2018-09-05 21:59:16
【问题描述】:
我有一个法语单词索引。我想对索引属性应用分析器。假设我有一个title 属性,我想将其视为“法国属性”。我试过这个(在 kibana 中):
PUT thing/_mappings/thing
{
"properties": {
"title": {
"type": "text",
"analyzer": "french",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
但结果是:
{
"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
}
我不明白为什么会出现此错误。如果我显示映射 (GET thing/_mappings),它不包含现有的分析器(除非我误解了什么):
// ...
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
如何将我的 title 财产视为法国财产?(来源:https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html)
【问题讨论】:
-
您是否还有另一个索引类型为
thing? -
@Val 谢谢你的回答。我对弹性搜索很陌生,有没有办法检查你的要求?
-
实际上你根本不允许更改
title字段的分析器,如果没有指定默认为standard。您需要删除索引并正确更改映射 -
好的,谢谢!所以,我必须重建所有? (所以删除索引,然后重新发布1G数据?)如果是这样,请随时发表您的评论作为答案,我会接受!
标签: elasticsearch mapping kibana