下载IK分词器:(可github下载,可以私信要)elasticsearch-analysis-ik-7.12.1.zip
进入容器:
在plugins目录下创建ik文件夹:
退出容器:
docker exec -it elasticsearch /bin/bash
cd plugins/
mkdir /usr/share/elasticsearch/plugins/ik
exit
拷贝下载好的ik分词器压缩包到ik文件夹中:
docker cp /home/ubuntu/elasticsearch-analysis-ik-7.12.1.zip elasticsearch:/usr/share/elasticsearch/plugins/ik/
重新进入容器
进入ik目录:
cd /usr/share/elasticsearch/plugins/ik
解压:
unzip elasticsearch-analysis-ik-7.12.1.zip
rm -rf elasticsearch-analysis-ik-7.12.1.zip
重启容器:
docker restart elasticsearch
docker ps