IK分词器是目前用的最广泛的中文分词器
elasticsearch安装ik plugin
bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.3.0/elasticsearch-analysis-ik-7.3.0.zip
检查plugins目录下有对应文件夹则表示安装
启动es后运行命令检查
# 标准分词
GET _analyze?pretty
{
"analyzer": "standard",
"text":"中华人名共和国国歌"
}
# 智能分词
GET _analyze?pretty
{
"analyzer": "ik_smart",
"text":"中华人名共和国国歌"
}
#最大化分词
GET _analyze?pretty
{
"analyzer": "ik_max_word",
"text":"中华人名共和国国歌"
}