进入到咱们ik分词器安装目录下的config目录java
cd /usr/local/myapp/elasticsearch-6.4.3/plugins/ik/config
vi IKAnalyzer.cfg.xml
IKAnalyzer.cfg.xml 的内容以下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<!--用户能够在这里配置本身的扩展字典 -->
<entry key="ext_dict"></entry>
<!--用户能够在这里配置本身的扩展中止词字典-->
<entry key="ext_stopwords"></entry>
<!--用户能够在这里配置远程扩展字典 -->
<!-- <entry key="remote_ext_dict">words_location</entry> -->
<!--用户能够在这里配置远程扩展中止词字典-->
<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>app
加红部分替换为elasticsearch
<!--用户能够在这里配置本身的扩展字典 -->spa
<entry key="ext_dict">custom/new_word.dic</entry>code
而后在config目录下新建文件夹xml
mkdir custom
vi custom/new_word.dic
写入相应内容blog
从新启动 服务Elasticsearch。。rem
再次搜索io
证实加载的分词生效了。ast