我正在开发一个ES插件,它包含一个新的分析器和一个新的过滤器。我的elasticsearch.yml文件如下-:
index:
analysis:
analyzer:
ik_syno:
tokenizer: ik
filter: [my_synonym_filter_ik]
ik_syno_smart:
tokenizer: ik_smart
filter: [my_synonym_filter_ik_smart]
filter:
my_synonym_filter_ik_smart:
type: org.elasticsearch.index.analysis.SynonymcnTokenFilterFactory
use_smart: true
my_synonym_filter_ik:
type: org.elasticsearch.index.analysis.SynonymcnTokenFilterFactory
use_smart: trueSynonymcnTokenFilterFactory是我的班。
现在,当我用
smart&pretty=true
分析器'ik_syno_smart‘如预期的那样工作。
{
"tokens" : [ {
"token" : "hello",
"start_offset" : 1,
"end_offset" : 6,
"type" : "ENGLISH",
"position" : 1
} ]
}但是,当我在映射调用中使用它时,它会返回错误。
这是我的索引字段
"content": {
"type": "string",
"index_analyzer": "ik_syno_smart",
"search_analyzer": "ik_smart",
"boost": "10"
},错误日志如下:
on [shard failure [failed to update mappings][MapperParsingException[Analyzer [ik_syno_smart] not found for field [content]]]]我做错什么了?我的ES版本是1.7.0。
发布于 2016-05-03 07:47:56
您必须始终在所有机器上安装插件,其他明智的ES将无法完成他的工作,因为当索引被分割到多台机器时,他们将负责工作。此外,如果您正在使用许多插件,那么在elasticsearch.yml中有一个很好的属性
plugin.mandatory: mapper-attachments,lang-groovy这将不会启动您的ES,直到您安装所有插件。不幸的是,它还不能自动地设置它们,但是它会防止一些您可以忘记的事情。
https://stackoverflow.com/questions/36038156
复制相似问题