下载地址:https://github.com/medcl/elasticsearch-analysis-pinyin/tree/v7.4.0
选择需要对应elasticsearch版本的插件
Elasticsearch pinyin 拼音分词器插件下载安装1.png
下载之后找到下面文件创建名为pinyin文件夹上传到elasticsearch中的plugins目录下
pinyin_alphabet.dict
plugin-descriptor.properties
nlp-lang-1.7.jar
elasticsearch-analysis-pinyin-5.6.12.jar
如果启动报错需要打开plugin-descriptor.properties修改成对应的版本好,参考以下配置

# Elasticsearch plugin descriptor file
# This file must exist as 'plugin-descriptor.properties' at
# the root directory of all plugins.
#
# A plugin can be 'site', 'jvm', or both.
#
### example site plugin for "foo":
#
# foo.zip <-- zip file for the plugin, with this structure:
#   _site/ <-- the contents that will be served
#   plugin-descriptor.properties <-- example contents below:
#
# site=true
# description=My cool plugin
# version=1.0
#
### example jvm plugin for "foo"
#
# foo.zip <-- zip file for the plugin, with this structure:
#   <arbitrary name1>.jar <-- classes, resources, dependencies
#   <arbitrary nameN>.jar <-- any number of jars
#   plugin-descriptor.properties <-- example contents below:
#
# jvm=true
# classname=foo.bar.BazPlugin
# description=My cool plugin
# version=2.0.0-rc1
# elasticsearch.version=2.0
# java.version=1.7
#
### mandatory elements for all plugins:
#
# 'description': simple summary of the plugin
description=${project.description}
#
# 'version': plugin's version
version=${project.version}
#
# 'name': the plugin name
name=${elasticsearch.plugin.name}

#
# 'classname': the name of the class to load, fully-qualified.
classname=org.elasticsearch.plugin.analysis.pinyin.AnalysisPinyinPlugin
#
# 'java.version' version of java the code is built against
# use the system property java.specification.version
# version string must be a sequence of nonnegative decimal integers
# separated by "."'s and may have leading zeros
java.version=1.8
#
# 'elasticsearch.version' version of elasticsearch compiled against
# You will have to release a new version of the plugin for each new
# elasticsearch release. This version is checked when the plugin
# is loaded so Elasticsearch will refuse to start in the presence of
# plugins with the incorrect elasticsearch.version.
elasticsearch.version=6.4.3
Last modification:October 24th, 2019 at 02:47 am
如果觉得这篇技术文章对你有用,请随意赞赏