ElasticSearch 中文分词插件安装

1. ik  
现在不支持bin/plugin -install medcl/elasticsearch-analysis-ik/1.1.3 
在elasticsearch/plugins目录下建analysis-ik目录 
然后直接下载安装包 
https://github.com/medcl/elasticsearch-rtf/tree/master/elasticsearch/plugins/analysis-ik 
Script代码   收藏代码
  1. cd plugins  
  2. mkdir analysis-ik  
  3. cd analysis-ik  
  4. wget https://github.com/medcl/elasticsearch-rtf/blob/master/elasticsearch/plugins/analysis-ik/elasticsearch-analysis-ik-1.1.4.jar?raw=true --no-check-certificate  


词库还是一样 
Script代码   收藏代码
  1. cd config  
  2. wget http://github.com/downloads/medcl/elasticsearch-analysis-ik/ik.zip --no-check-certificate  
  3. unzip ik.zip  
  4. rm ik.zip  


2. mmseg (https://github.com/medcl/elasticsearch-analysis-mmseg)
直接下载安装包安装 
Script代码   收藏代码
  1. cd plugins  
  2. mkdir analysis-mmseg  
  3. cd analysis-mmseg  
  4. wget https://github.com/medcl/elasticsearch-rtf/blob/master/elasticsearch/plugins/analysis-mmseg/elasticsearch-analysis-mmseg-1.1.2.jar?raw=true --no-check-certificate  


词库 
Script代码   收藏代码
  1. cd config  
  2. mkdir mmseg  
  3. wget https://github.com/medcl/elasticsearch-rtf/raw/master/elasticsearch/config/mmseg/chars.dic --no-check-certificate  
  4. wget https://github.com/medcl/elasticsearch-rtf/raw/master/elasticsearch/config/mmseg/units.dic --no-check-certificate  
  5. wget https://github.com/medcl/elasticsearch-rtf/raw/master/elasticsearch/config/mmseg/words-my.dic --no-check-certificate  
  6. wget https://github.com/medcl/elasticsearch-rtf/raw/master/elasticsearch/config/mmseg/words.dic --no-check-certificate  


3. paoding 
直接下载安装包安装 
Script代码   收藏代码
  1. cd plugins  
  2. mkdir analysis-paoding  
  3. cd analysis-paoding  
  4. wget https://github.com/medcl/elasticsearch-rtf/blob/master/elasticsearch/plugins/analysis-paoding/elasticsearch-analysis-paoding-1.0.1.jar?raw=true --no-check-certificate  


词库 
Script代码   收藏代码
  1. cd config  
  2. mkdir paoding  
  3. wget https://github.com/downloads/medcl/elasticsearch-analysis-paoding/config.zip --no-check-certificate  
  4. unzip config.zip  
  5. cp -rp config/paoding/* .  
  6. rm -rf config  
  7. rm config.zip  


完整elasticsearch配置 
编辑elasticsearch.yml 

Script代码   收藏代码
  1. index:  
  2.   analysis:  
  3.     tokenizer:  
  4.       mmseg_maxword:  
  5.           type: mmseg  
  6.           seg_type: "max_word"  
  7.       mmseg_complex:  
  8.           type: mmseg  
  9.           seg_type: "complex"  
  10.       mmseg_simple:  
  11.           type: mmseg  
  12.           seg_type: "simple"  
  13.     analyzer:  
  14.       mmseg:  
  15.           alias: [news_analyzer, mmseg_analyzer]  
  16.           type: org.elasticsearch.index.analysis.MMsegAnalyzerProvider  
  17.       ik:  
  18.           alias: [ik_analyzer]  
  19.           type: org.elasticsearch.index.analysis.IkAnalyzerProvider  
  20.       ik_max_word:  
  21.           type: ik  
  22.           use_smart: false  
  23.       ik_smart:  
  24.           type: ik  
  25.           use_smart: true  
  26.       paoding:  
  27.           alias: [paoding_analyzer]  
  28.           type: org.elasticsearch.index.analysis.PaodingAnalyzerProvider  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值