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
        }
    ]
}
相关推荐
风途科技~7 分钟前
隧道氮氧化物检测仪|实时监测 NO、NO₂浓度,助力公路隧道通风智能调控
大数据·人工智能
Linux运维技术栈16 分钟前
业务不停机、数据零丢失:Redis / RabbitMQ / Elasticsearch 三大核心中间件升级改造集群无缝平滑迁移
redis·elasticsearch·rabbitmq
ACP广源盛1392462567339 分钟前
Qwen3.8-Max 开源预期下@ACP#企业级终端硬件演进机遇与 PCIe 交换芯片落地分析
大数据·人工智能·分布式·单片机·嵌入式硬件
Elasticsearch2 小时前
15 行点击跟踪代码,告诉你搜索日志无法揭示的信息
elasticsearch
遨游DATA2 小时前
Jenkins 修改 config.xml 后页面仍是旧配置:让 live job 配置真正生效
ci/cd·jenkins·devops·故障排查·config.xml
汽车仪器仪表相关领域3 小时前
NHA-604/605汽车排放气体测试仪:00级国标计量|多动力车型兼容|移动/固定双工况|智能联网尾气检测设备
大数据·人工智能·功能测试·安全·汽车·压力测试·可用性测试
Elastic 中国社区官方博客3 小时前
Elasticsearch:语义搜索快速入门
大数据·人工智能·elasticsearch·搜索引擎·全文检索
Dobby_053 小时前
【CICD】Jenkins Pipeline 快速学习入门
运维·学习·jenkins
观远数据3 小时前
Excel继续用、自研BI、替换BI:产品VP拆解三条路线的隐性成本与能力边界
大数据·人工智能·excel
陕西企来客11 小时前
2026年7月AI智能搜索曝光趋势研判
大数据·人工智能·机器学习·ai智能搜索曝光