elasticsearch中文分词器插件下载

elasticsearch中文分词器插件下载

    • [1. 下载](#1. 下载)
    • [2. 查看插件是否生效](#2. 查看插件是否生效)
    • [3. 测试分词器效果](#3. 测试分词器效果)

1. 下载

下载地址:https://release.infinilabs.com/analysis-ik/stable 与当前es版本匹配

复制代码
[elasticsearch@elastic-server ~]$ cd /opt/
[elasticsearch@elastic-server opt]$ sudo curl -O https://release.infinilabs.com/analysis-ik/stable/elasticsearch-analysis-ik-9.1.5.zip
[elasticsearch@elastic-server opt]$ sudo chown elasticsearch.elasticsearch elasticsearch-analysis-ik-9.1.5.zip
# 安装插件
[elasticsearch@elastic-server elasticsearch-9.1.5]$ ./bin/elasticsearch-plugin install file:///opt/elasticsearch-analysis-ik-9.1.5.zip
clike 复制代码
-> Installing file:///opt/elasticsearch-analysis-ik-9.1.5.zip
-> Downloading file:///opt/elasticsearch-analysis-ik-9.1.5.zip
[=================================================] 100%  
WARNING: this plugin contains a legacy Security Policy file. Starting with version 8.18, Entitlements replace SecurityManager as the security mechanism. Plugins must migrate their policy files to the new format. For more information, please refer to https://www.elastic.co/guide/en/elasticsearch/plugins/current/creating-classic-plugins.html
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional entitlements    @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* outbound_network
See https://www.elastic.co/guide/en/elasticsearch/plugins/current/creating-classic-plugins.html
for descriptions of what these entitlements allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik
-> Please restart Elasticsearch to activate any plugins installed

重启elasticsearch

2. 查看插件是否生效

3. 测试分词器效果

复制代码
# 创建索引
PUT /first_index
# 指定content字段是呀ik分词器
POST /first_index/_mapping
{
    "properties": {
        "content": {
            "type": "text",
            "analyzer": "ik_smart",
            "search_analyzer": "ik_smart"
        }
    }
}
# 插入数据
POST /first_index/_create/1
{
    "content": "我是祖国的花朵"
}
# 通过分词获取数据
GET  /first_index/_search
{
    "query": {
        "match": {
            "content": "花朵"
        }
    }
}
相关推荐
Elastic 中国社区官方博客11 小时前
Elasticsearch:如何使用 LLM 在摄入数据时提取需要的信息
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索
迎仔11 小时前
Elasticsearch:大数据的超级索引引擎
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客11 小时前
Elasticsearch:监控 LLM 推理和 Agent Builder 使用 OpenRouter
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
安河桥畔13 小时前
Git使用
大数据·git·elasticsearch
小北方城市网13 小时前
MyBatis 进阶实战:插件开发与性能优化
数据库·redis·python·elasticsearch·缓存·性能优化·mybatis
☀Mark_LY13 小时前
elasticsearch7集群Linux部署
linux·elasticsearch
秃了也弱了。13 小时前
elasticSearch之API:文本分词,分词器的使用(上)
大数据·elasticsearch
Lam㊣1 天前
Ubuntu系统安装Elasticsearch
ubuntu·elasticsearch·jenkins
小北方城市网2 天前
Redis 缓存设计与避坑实战:解决穿透 / 击穿 / 雪崩
java·大数据·数据库·redis·python·elasticsearch·缓存
CCPC不拿奖不改名2 天前
两种完整的 Git 分支协作流程
大数据·人工智能·git·python·elasticsearch·搜索引擎·自然语言处理