zoukankan      html  css  js  c++  java
  • elasticsearch扩展ik分词器词库

    操作步骤

    1、进入elasticsearch的plugin,进入ik。进入config。
    2、在config下面建立以.dic为后缀的字典。在建立的时候一定要注意文本的报错格式,请保存为utf-8格式的,其他格式不能使用。文件如果在linux中通过vi生成,则不用管格式。可以直接使用。
    3、建立好后,在里面输入我们的扩展词语。每个扩展词语一行。
    4、维护好字典后,编辑IKAnalyzer.cfg.xml。

    <properties>
      <comment>IK Analyzer 扩展配置</comment>
     
      <!--用户可以在这里配置自己的扩展字典,多个字典使用;号进行隔开 -->
      <entry key="ext_dict">custom.dic</entry>
     
      <!--用户可以在这里配置自己的扩展停止词字典-->
      <entry key="ext_stopwords">custom.dic</entry>
    
    </properties>
    

    所谓停止词字典,就是说如果遇到该词请不要认为是一个词。
    5、重启后,分词效果即生效。

  • 相关阅读:
    443. String Compression
    506. Relative Ranks
    825. Friends Of Appropriate Ages
    447. Number of Boomerangs
    54. Spiral Matrix
    744. Find Smallest Letter Greater Than Target
    HDU-1565 方格取数(1)
    zoj 3672 Gao The Sequence
    ZOJ 3675 Trim the Nails
    poj -2955 Brackets
  • 原文地址:https://www.cnblogs.com/jichi/p/12450036.html
Copyright © 2011-2022 走看看