Elasticsearch-ik分析器

复制代码
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
        }
    ]
}
相关推荐
木圭的AI时代指南5 小时前
Spark-X2.5 长输入 Agent 实测:全量读取陷阱与解释器寻找死循环复盘,附可复现任务
大数据·分布式·spark
dongsdh6 小时前
部署python
大数据·elasticsearch·搜索引擎
QYR-分析7 小时前
重轨受电弓行业深度报告:市场格局、技术迭代与发展前景
大数据·数据库·人工智能
镜像视界(浙江)科技有限公司7 小时前
《视频孪生之上:二维展示终结,三维空间计算重构城市逻辑》——跨摄像连续表达 × 三角测量厘米级定位 × 动态轨迹建模,构建新一代城市空间
大数据·人工智能·算法·矩阵·音视频·空间计算
大大大大晴天7 小时前
每天认识一个组件:元数据平台 DataHub
大数据
m0_547486668 小时前
《大数据分析导论》全套PPT课件2026
大数据·大数据分析
starzy19908 小时前
Flink高级之CEP深度剖析:Pattern API、NFA引擎与风控实战
大数据·flink
星禾元亨10 小时前
生成式 AI 时代的架构演进与 GEO 优化:实体企业 AI 落地避坑指南
大数据·人工智能·架构·自动化·创业创新
IT毕设实战小研10 小时前
基于大数据的国内主要农作物产量趋势分析与可视化
android·java·大数据·django·课程设计
OFIRM碳基硅基11 小时前
西游金蝉劫 IP · 之 《金蝉子前传渡缘劫》电影 20 亿票房触发 · 项目专项扶持协议 总览 拉格朗日光影动画-西游金蝉劫项目组
大数据·人工智能·西游金蝉劫·蝎子精·蝎子精女妖王·金蝉子前传渡缘劫