ElasticSearch配置中文分词器

中文分词器下载地址 https://github.com/medcl/elasticsearch-analysis-ik

 

elasticsearch-analysis-ik-master.zip

 

安装配置apache-maven

 

http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
tar -zxvf apache-maven-3.5.4-bin.tar.gz 
mv apache-maven-3.5.4 /usr/local
cd /usr/local
ln -s  apache-maven-3.5.4 apache-maven
vim /etc/profile
export PATH=/usr/local/apache-maven/bin:$PATH

 

使用mvn 对elasticsearch-analysis-ik-master 进行编译

 

unzip elasticsearch-analysis-ik-master.zip
mv elasticsearch-analysis-ik-master /usr/local
cd /usr/local/elasticsearch-analysis-ik-master
mvn clean install -Dmaven.test.skip=true

 

会生成elasticsearch-analysis-ik-master/target/releases/elasticsearch-analysis-ik-6.5.0.zip

 

将其拷贝到es的插件目录下

 

mkdir /usr/local/elasticsearch/plugins/ik/
cp elasticsearch-analysis-ik-master/target/releases/elasticsearch-analysis-ik-6.5.0.zip /usr/local/elasticsearch/plugins/ik/
unzip /usr/local/elasticsearch/plugins/ik/elasticsearch-analysis-ik-6.5.0.zip

 

编译后会是最新版的中文分词包,对应es的6.2.4 可以去下载编译好的

 

https://github-production-release-asset-2e65be.s3.amazonaws.com/2993595/f204cb62-5163-11e8-88b4-f853c190d22b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190228%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190228T080403Z&X-Amz-Expires=300&X-Amz-Signature=927a44a7e90f039be5d2014ba47a1a253ddb0c6174302b8f259da97291165d65&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Delasticsearch-analysis-ik-6.2.4.zip&response-content-type=application%2Foctet-stream

 

修改文件属主

 

chown -R esuser:esgroup /usr/local/elasticsearch/plugins

发表评论

电子邮件地址不会被公开。 必填项已用*标注