官网下载zip地址(一定要下载与es同版本):
Tags · medcl/elasticsearch-analysis-ik · GitHubhttps://github.com/medcl/elasticsearch-analysis-ik/tags下载后本地创建 ik 文件夹 存放解压缩后所有文件
将 ik 文件夹 发送到 es 所有节点 es安装目录 /plugins 下
(默认es安装路径为: /usr/share/elasticsearch/plugins)
发送完成后重启es
systemctl restart elasticsearch.service
测试是否成功
ik_smart案例
curl -X GET -H "Content-Type: application/json" "http://localhost:9200/_analyze?pretty=true" -d'{"text":"我的老家就住在这个屯","analyzer": "ik_smart"}'
ik_max_word案例
curl -X GET -H "Content-Type: application/json" "http://localhost:9200/_analyze?pretty=true" -d'{"text":"我的老家就住在这个屯","analyzer": "ik_max_word"}'