Elasticsearch的IK分词器配置说明

2018-12-10  本文已影响0人  simonsgj
IKAnalyzer.cfg.xml:用来配置自定义词库
main.dic:ik原生内置的中文词库,总共有27万多条,只要是这些单词,都会被分在一起
quantifier.dic:放了一些单位相关的词
suffix.dic:放了一些后缀
surname.dic:中国的姓氏
stopword.dic:英文停用词

一般像停用词,会在分词的时候,直接被干掉,不会建立在倒排索引中

<properties>
    <comment>IK Analyzer 扩展配置</comment>
    <!--用户可以在这里配置自己的扩展字典 -->
    <entry key="ext_dict">custom/mydict.dic;custom/single_word_low_freq.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>

可知,我们只需要补充我们的新词语到custom/mydict.dic或custom/single_word_low_freq.dic这两个字典文件其中之一即可。
一般都指定到custom/mydict.dic这里。
将停用词(如:了,的,呢等,但是这些基本的IK已经给我们都写了,如有补充,写到这里即可)指定到custom/ext_stopword.dic里

上一篇 下一篇

猜你喜欢

热点阅读