ElasticSearch 6.5.4 安装中文分词器 IK和pinyiin

ES的常用的中文分词有基于汉字的ik和基于拼音的pinyin

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

https://github.com/medcl/elasticsearch-analysis-pinyin

安装的时候主要选择elasticsearch版本一致的插件:
-- ES的版本查询:
# /usr/share/elasticsearch/bin/elasticsearch -V
Version: 6.5.4, Build: default/rpm/d2ef93d/2018-12-17T21:17:40.758843Z, JVM: 1.8.0_192

安装方式:
1.直接使用zip包,下载解压到plugin目录部署,此方式适合下载一次多次应用的场景。

2.使用Elasticsearch自己带的命令安装zip包。在线安装zip包视视网络环境而定。

由于使用的RPM安装的,可以直接使用命令:
# rpm -ql elasticsearch  | grep -i elasticsearch-plugin 
/usr/share/elasticsearch/bin/elasticsearch-plugin
/usr/share/elasticsearch/lib/tools/plugin-cli/elasticsearch-plugin-cli-6.5.4.jar

# cd /usr/share/elasticsearch/bin/

# ./elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.4/elasticsearch-analysis-ik-6.5.4.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.4/elasticsearch-analysis-ik-6.5.4.zip
[=================================================] 100%   
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik



--验证安装是否成功:
# curl http://192.168.3.113:9200/_cat/plugins
GS9-MID analysis-ik 6.5.4


# wget https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v6.5.4/elasticsearch-analysis-pinyin-6.5.4.zip

#mkdir -p /usr/share/elasticsearch/plugins/analysis-pinyin
# unzip elasticsearch-analysis-pinyin-6.5.4.zip -d /usr/share/elasticsearch/plugins/analysis-pinyin/

--版本查看:
# curl http://192.168.3.113:9200/_cat/plugins
GS9-MID analysis-ik     6.5.4
GS9-MID analysis-pinyin 6.5.4



 

你可能感兴趣的:(Elasticsearch)