安装好es之后,先安装插件,安装ik的插件需要下载和es对应的版本。
https://github.com/medcl/elasticsearch-analysis-ik/tags
解压到新建的ik文件夹,再把ik文件夹放到es的plugins文件夹下。
将自定义的停词和词库添加到ik文件夹下的config文件夹的对应文件中
下面是配置文件的内容 IKAnalyzer.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer Config</comment>
<entry key="ext_dict">main.dic</entry>
<entry key="ext_stopwords">stopword.dic;quantifier.dic</entry>
</properties>
重启es就行