我进行了多模型搜索,我的配置如下:
settings analysis: {
...
} do
mappings do
indexes "_all",
type: "string",
analyzer: "ngram_analyzer",
search_analyzer: "whitespace_analyzer"
end
end
这一切在Elasticsearch 2.1上都运行良好,但在2.2中打破了:
Elasticsearch::Transport::Transport::Errors::BadRequest: [400]
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [insurer]: Field [_all] is defined twice in [insurer]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [insurer]: Field [_all] is defined twice in [insurer]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Field [_all] is defined twice in [insurer]"
}
},
"status": 400
}
如何修复它以索引2.2中的all
字段?
答案 0 :(得分:0)
好的,事实证明我需要将映射更改为:
settings analysis: {
...
} do
mappings _all: {
type: "string", analyzer: "ngram_analyzer", search_analyzer: "whitespace_analyzer"
}
end
现在效果很好。