elasticsearch安装ik分词

ik分词插件下载

https://github.com/medcl/elasticsearch-analysis-ik/releases

下载对应elasticsearch版本的ik分词

如: elasticsearch2.4对应ik版本:v1.10.4

下载好后解压到elastisearch安装目录下的plugins目录中

../elasticsearch/plugins

添加自己的字典

将字典放到

../elasticsearch-2.4.4/plugins/elasticsearch-analysis-ik-1.10.4/config/custom/mine.dic

并配置IKAnalyzer.cfg.xml 路径:

../elasticsearch-2.4.4/plugins/elasticsearch-analysis-ik-1.10.4/config/IKAnalyzer.cfg.xml

将自己添加的字典加入到entry key="ext_dict"

<?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">custom/mydict.dic;custom/single_word_low_freq.dic;custom/company.dic</entry>
     <!--用户可以在这里配置自己的扩展停止词字典-->
    <entry key="ext_stopwords">custom/ext_stopword.dic</entry>
    <!--用户可以在这里配置远程扩展字典 -->
    <!-- <entry key="remote_ext_dict">words_location</entry> -->
    <!--用户可以在这里配置远程扩展停止词字典-->
    <!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>
原文地址:https://www.cnblogs.com/xmeo/p/6964685.html