zoukankan      html  css  js  c++  java
  • ELK---- Elasticsearch 使用ik中文分词器增加拓展热词

    进入到我们ik分词器安装目录下的config目录

    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>

    加红部分替换为

     <!--用户可以在这里配置自己的扩展字典 -->

        <entry key="ext_dict">custom/new_word.dic</entry>

    然后在config目录下新建文件夹

    mkdir custom
    vi custom/new_word.dic

    写入相应内容

    重新启动 服务Elasticsearch。。

    再次搜索

    证明加载的分词生效了。

  • 相关阅读:
    RobotFrameWork-Python简易环境搭建
    Oracle常用函数
    Oracle多表连接查询Join
    测试用例的常用设计方法
    App自动化测试之Monkey使用场景及常用命令
    App自动化测试之Adb基础命令使用
    App弱网测试
    前端基础(二)
    py自动化框架(二)
    html基础js
  • 原文地址:https://www.cnblogs.com/a393060727/p/12099651.html
Copyright © 2011-2022 走看看