背景:ES自带的分词器只适合英文,因为英文语法使用空格进行分词。但是中文不是。所以国人开发了这款中文分词器:IK
安装步骤略
一。ik_max_word分词器
GET _analyze
{
"text":"我们在夏季的花海",
"analyzer": "ik_max_word"
}
显示结果:
{
"tokens" : [
{
"token" : "我们",
"start_offset" : 0,
"end_offset" : 2,
"type" : "CN_WORD",
"position" : 0
},
{
"token" : "在",
"start_offset" : 2,
"end_offset" : 3,
"type" : "CN_CHAR",
"position" : 1
},
{
"token" : "夏季",
"start_offset" : 3,
"end_offset" : 5,
"type" : "CN_WORD",
"position" : 2
},
{
"token" : "的花海",
"start_offset" : 5,
"end_offset"