CLI 安装步骤
1、停止 Elasticsearch(如果正在运行): 在安装插件之前,确保 Elasticsearch 没有在运行。
命令:
systemctl stop elasticsearch
2、安装插件: 使用 elasticsearch-plugin 命令安装 IK 插件。
进入到你的es的安装目录:如/usr/local/software/elasticsearch
[root@localhost elasticsearch]# bin/elasticsearch-plugin install https://get.infini.cloud/elasticsearch/analysis-ik/8.17.0
其中analysis-ik/8.17.0对应你自己安装es的版本
warning: ignoring JAVA_HOME=/usr/local/software/jdk-21.0.5; using bundled JDK
-> Installing https://get.infini.cloud/elasticsearch/analysis-ik/8.17.0
-> Downloading https://get.infini.cloud/elasticsearch/analysis-ik/8.17.0
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See https://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 (此处选择y)
-> Installed analysis-ik
-> Please restart Elasticsearch to activate any plugins installed
3、查看ik分词器是否安装成功
[root@localhost elasticsearch]# curl -X GET "localhost:9200/_cat/plugins?v"
name component version
localhost.localdomain analysis-ik 8.17.0
4、重启 Elasticsearch:
安装完成后,重启 Elasticsearch 使插件生效。
systemctl stop elasticsearch
systemctl start elasticsearch
查看状态
systemctl status elasticsearch
查看日志
journalctl -u elasticsearch -f
5、查看日志载入插件里有个名为:loaded plugin [analysis-ik]
cat /usr/local/software/elasticsearch/logs/elasticsearch.log
[2025-07-25T13:28:57,460][INFO ][o.e.p.PluginsService ] [localhost.localdomain] loaded plugin [analysis-ik]
我是中国人,的ik分词情况
{
"tokens": [
{
"token": "我",
"start_offset": 0,
"end_offset": 1,
"type": "CN_CHAR",
"position": 0
},
{
"token": "是",
"start_offset": 1,
"end_offset": 2,
"type": "CN_CHAR",
"position": 1
},
{
"token": "中国人",
"start_offset": 2,
"end_offset": 5,
"type": "CN_WORD",
"position": 2
},
{
"token": "中国",
"start_offset": 2,
"end_offset": 4,
"type": "CN_WORD",
"position": 3
},
{
"token": "国人",
"start_offset": 3,
"end_offset": 5,
"type": "CN_WORD",
"position": 4
}
]
}
Elasticsearch-ik分析器
mykyle2025-07-27 20:00
相关推荐
会议咨询1 小时前
2027年电力电子、人工智能与大数据国际会议(PEABD 2027)GlobalInfo2 小时前
全球包装检测用3D轮廓传感器市场调研:2026年规模预计达1.87亿美元,食品医药与电商物流需求推动增长程序 代码狂人2 小时前
切片表与分区表的区别(数据开发面试版)starzy19903 小时前
Kafka响应发送:字节是怎么真正写回客户端的数字新视界4 小时前
国产动环数据库在智能机房环境监控中的应用与优势分析古法老登瞎折腾4 小时前
大数据智能运维实战(九):让 AI 查日志——找到异常,也保留上下文keyipatience4 小时前
Git学习(2)撤销与分支操作全指南数字新视界4 小时前
模块化机房的设计与实施原理剖析用户3610588626125 小时前
Flink 注册Slot源码深度剖析:从TaskManager注册到Slot状态机的完整链路一线数智6 小时前
来腾讯云AI开放日 加入人类职业进化计划