Open chuangfengwang opened 2 years ago
can’t install by elasticsearch-plugin install
unzip and copy thulac to elasticsearch‘s plugins download models file Models_v1_v2.zip,unzip and copy models to elasticsearch‘s plugins/models
restart elasticsearch
这个插件分词效果不错,新词识别很好,编译稍高版本的ES插件,也很容易(7.16.2版本使用正常),值得推荐,
但是有个问题,如果内容中包含空格时(也许还有其它特殊字符),offset会忽略空格,导致查询结果高亮位置不对。
GET _analyze { "text": "测试 分词,这个一个分词测试", "analyzer":"thulac" }
{ "tokens": [ { "token": "测试", "start_offset": 0, "end_offset": 2, "type": "word", "position": 0 }, { "token": "分词", "start_offset": 2,------IK这里是3 "end_offset": 4,-------IK这里是5 "type": "word", "position": 1 } ] }
查询“分词”的话,高亮结果
测试<em> 分</em>词,这个一<em>个分</em>词测试
Got error when install 7.9.1. Anything is wrong?
env
ubuntu20.04 elasticsearch version is 7.9.1.
operation is here
download the zip from https://github.com/microbun/elasticsearch-thulac-plugin/releases/tag/7.9.1
bin/elasticsearch-plugin install file:///home/wcf/Setups/elk7.9.1/elasticsearch-plugins/elasticsearch-thulac-plugin-7.9.1.zip
and got exception as follow