Closed xl876075921 closed 3 years ago
es 7.6.2 同义词为 童宝宝,童宝保,童安宝,三个词都已经添加到ik的词库中. 索引分词器配置为 "ik-smart-synonym": { "type": "custom", "tokenizer": "ik_smart", "filter": [ "local_synonym" ] } 测试分词 { "text": "童宝保", "analyzer": "ik-smart-synonym" } 分词结果 { "tokens" : [ { "token" : "童宝保", "start_offset" : 0, "end_offset" : 3, "type" : "CN_WORD", "position" : 0 }, { "token" : "童宝宝", "start_offset" : 0, "end_offset" : 3, "type" : "SYNONYM", "position" : 0 }, { "token" : "童安宝", "start_offset" : 0, "end_offset" : 3, "type" : "SYNONYM", "position" : 0 }, { "token" : "宝宝", "start_offset" : 0, "end_offset" : 3, "type" : "SYNONYM", "position" : 1 } ] } 测试分词 { "text": "童宝宝", "analyzer": "ik-smart-synonym" } 分词结果 { "tokens" : [ { "token" : "童宝宝", "start_offset" : 0, "end_offset" : 3, "type" : "CN_WORD", "position" : 0 } ] }
es 7.6.2 同义词为 童宝宝,童宝保,童安宝,三个词都已经添加到ik的词库中. 索引分词器配置为 "ik-smart-synonym": { "type": "custom", "tokenizer": "ik_smart", "filter": [ "local_synonym" ] } 测试分词 { "text": "童宝保", "analyzer": "ik-smart-synonym" } 分词结果 { "tokens" : [ { "token" : "童宝保", "start_offset" : 0, "end_offset" : 3, "type" : "CN_WORD", "position" : 0 }, { "token" : "童宝宝", "start_offset" : 0, "end_offset" : 3, "type" : "SYNONYM", "position" : 0 }, { "token" : "童安宝", "start_offset" : 0, "end_offset" : 3, "type" : "SYNONYM", "position" : 0 }, { "token" : "宝宝", "start_offset" : 0, "end_offset" : 3, "type" : "SYNONYM", "position" : 1 } ] } 测试分词 { "text": "童宝宝", "analyzer": "ik-smart-synonym" } 分词结果 { "tokens" : [ { "token" : "童宝宝", "start_offset" : 0, "end_offset" : 3, "type" : "CN_WORD", "position" : 0 } ] }