es版本:5.0.2,我下载了[url=https://github.com/medcl/elasticsearch-analysis-ik]https://github.com/medcl/elasticsearch-analysis-ik[/url] 然后因为应用场景的需要,我修改了ik分词源码,增加了一些参数,我需要在es中配置几个analyzer,因为现在不能直接在yml配置了,所以使用了indices template,对应配置如下:
{
"template" : ["*"],
"order" : 0,
"settings" : {
"analysis" : {
"analyzer" : {
"ik" : {
"alias" : ["ik_analyzer"],
"type" : "org.elasticsearch.plugin.analysis.ik.AnalysisIkPlugin",
"use_smart" : "false",
"cut_formula" : "true"
},
"ik_max_word" : {
"type" : "ik",
"use_smart" : "false",
"cut_formula" : "true"
},
"ik_smart" : {
"type" : "ik",
"use_smart" : "true",
"cut_formula" : "false"
},
"ik_smart_cut_formula" : {
"type" : "ik",
"use_smart" : "true",
"cut_formula" : "true"
},
"ik_not_cut_formula" : {
"type" : "ik",
"use_smart" : "false",
"cut_formula" : "false"
}
}
}
}
}
会报错Unknown analyzer type [org.elasticsearch.plugin.analysis.ik.AnalysisIkPlugin] for [ik]。其中,cut_formula就是我新添加的控制分词的参数。求大神们帮忙分析一下,有原理更好了。谢谢!!!
2 个回复
ybtsdst - focus on lucene & es
赞同来自:
medcl - 今晚打老虎。
赞同来自:
因为太不安全了。