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": "花朵"
        }
    }
}
相关推荐
Java 码思客1 小时前
【ElasticSearch从入门到架构师】第1章:ElasticSearch 核心认知与行业定位
大数据·elasticsearch·搜索引擎
serve the people5 小时前
Elasticsearch(5) i want to monitor the es health from a http api
大数据·http·elasticsearch
Taerge01107 小时前
Doris, StarRocks, ClickHouse, Hologres, ES 对比,选型建议
大数据·clickhouse·elasticsearch
serve the people18 小时前
Elasticsearch(1) could you tell me how to use es if i am a beginner
大数据·elasticsearch·jenkins
一个儒雅随和的男子19 小时前
Elasticsearch出现深度分页问题怎么解决?
大数据·elasticsearch·搜索引擎
serve the people1 天前
Elasticsearch(3) show me some examples
大数据·elasticsearch·jenkins
是一个Bug1 天前
Elasticsearch 保姆级入门:从“找文件”到“秒级搜索”
大数据·elasticsearch·搜索引擎
serve the people1 天前
Elasticsearch(4) show me some more advanced content
大数据·elasticsearch·jenkins
fangdengfu1232 天前
ES分析系统各个服务日志占用量
java·前端·elasticsearch
兄台の请冷静2 天前
Linux 安装es
linux·elasticsearch·jenkins