elasticsearch安装分词器插件

查看插件安装情况

elasticsearch-plugin list

插件在线安装

bin/elasticsearch-plugin install analysis-icu

离线安装ik分词

cd plugins
wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.17.7/elasticsearch-analysis-ik-7.17.7.zip
unzip elasticsearch-analysis-ik-7.17.7.zip -d analysis-ik

离线安装pinyin分词

cd plugins
wget https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.17.6/elasticsearch-analysis-pinyin-7.17.6.zip
unzip elasticsearch-analysis-pinyin-7.17.6.zip -d analysis-pinyin

重启服务报错

[es@VM-4-5-centos bin]$ Nov 22, 2023 10:26:58 AM sun.util.locale.provider.LocaleProviderAdapter 
WARNING: COMPAT locale provider will be removed in a future release
uncaught exception in thread [main]
java.lang.IllegalArgumentException: Plugin [analysis-ik] was built for Elasticsearch version 7.17.7 but version 7.17.15 is running

修改分词器对应es版本

cd plugins/ik/
 
# 修改 plugin-descriptor.properties 文件
vim plugin-descriptor.properties
 
# 修改 elasticsearch.version 为ES的版本号
elasticsearch.version=你的ES版本号
 
# 保存退出
:wq

使用

标准

elasticsearch安装分词器插件_第1张图片

icu

elasticsearch安装分词器插件_第2张图片

ik

elasticsearch安装分词器插件_第3张图片

你可能感兴趣的:(elasticsearch,elasticsearch,大数据)