ik分词器对中文支持较好的开源分词器,开源地址为https://github.com/medcl/elasticsearch-analysis-ik
使用注意事项:
- ik分词器的版本必须和elasticsearch的版本对应;
- 官网上7.x的源码下来后,编译出来的版本仍然是7.0的,需要手动在下载的源码中elasticsearch的版本改正为对应的7.X版本,应该是开发者手误;
将 <elasticsearch.version>7.0.0</elasticsearch.version>更正如下:
<properties>
<elasticsearch.version>7.3.1</elasticsearch.version>
<maven.compiler.target>1.8</maven.compiler.target>
<elasticsearch.assembly.descriptor>${project.basedir}/src/main/assemblies/plugin.xml</elasticsearch.assembly.descriptor>
<elasticsearch.plugin.name>analysis-ik</elasticsearch.plugin.name>
<elasticsearch.plugin.classname>org.elasticsearch.plugin.analysis.ik.AnalysisIkPlugin</elasticsearch.plugin.classname>
<elasticsearch.plugin.jvm>true</elasticsearch.plugin.jvm>
<tests.rest.load_packaged>false</tests.rest.load_packaged>
<skip.unit.tests>true</skip.unit.tests>
<gpg.keyname>4E899B30</gpg.keyname>
<gpg.useagent>true</gpg.useagent>
</properties>
参考文章:
elasticsearch7.3版本已经不需要额外安装中文分词插件了
ElasticSearch7.2.0安装以及IK分词器安装时的避坑手册