ES7 (two): IK Chinese word segmentation installation

1. Download the
git address of IK Chinese analyzer : https://github.com/medcl/elasticsearch-analysis-ik/releases
Insert picture description here

Note: The version must be the same as elasticsearch, here I choose 7.4.0
2. Installation

# 创建一个文件夹,譬如叫做es74
mkdir es74
# 拷贝正在运行elasticsearch的文件到es74文件夹
docker cp es:/usr/share/elasticsearch /home/shenyi/es74
# 在该文件夹创建叫做ik的目录
mkdir /home/shenyi/es74/elasticsearch/plugins/ik
# 然后把下载的中文分析器解压后拷贝到ik目录
# 重新启动
docker stop es && docker rm es
docker run -d --name es -v /home/shenyi/es74/elasticsearch:/usr/share/elasticsearch -p 9200:9200 es:74

3. Test
Insert picture description here
Supplement:
Error 1: The mapped directory does not have access permissions.
Insert picture description here
Solution:

chown -R shenyi:shenyi /home/shenyi/es74/elasticsearch

Mistake 2: The elasticsearch and IK versions do not correspond (my elasticsearch version is obviously 7.4.0, but the above said it is 7.4.2, I really took it)
Insert picture description here
Solution:

# 修改配置文件
sudo vi es74/elasticsearch/plugins/ik/plugin-descriptor.properties
# 在最底下修改,然后保存退出
elasticsearch.version=你的ES版本号

Guess you like

Origin blog.csdn.net/qq_36453564/article/details/108583173