摄影模式honeyselect ik插件件怎么用

55500人阅读
elasticsearch
大数据(2)
云计算(1)
Elasticsearch默认提供的分词器,会把每个汉字分开,而不是我们想要的根据关键词来分词。例如:
curl -XPOST
&http://localhost:9200/userinfo/_analyze?analyzer=standard&pretty=true&text=我是中国人&我们会得到这样的结果:
token: text
start_offset: 2
end_offset: 6
type: &ALPHANUM&
position: 1
start_offset: 9
end_offset: 10
type: &IDEOGRAPHIC&
position: 2
start_offset: 10
end_offset: 11
type: &IDEOGRAPHIC&
position: 3
start_offset: 11
end_offset: 12
type: &IDEOGRAPHIC&
position: 4
start_offset: 12
end_offset: 13
type: &IDEOGRAPHIC&
position: 5
start_offset: 13
end_offset: 14
type: &IDEOGRAPHIC&
position: 6
}正常情况下,这不是我们想要的结果,比如我们更希望 “中国人”,“中国”,“我”这样的分词,这样我们就需要安装中文分词插件,ik就是实现这个功能的。
elasticsearch-analysis-ik
是一款中文的分词插件,支持自定义词库。
安装步骤:
1、到github网站下载源代码,网站地址为:
右侧下方有一个按钮“Download ZIP&,点击下载源代码elasticsearch-analysis-ik-master.zip。
2、解压文件elasticsearch-analysis-ik-master.zip,进入下载目录,执行命令:
unzip elasticsearch-analysis-ik-master.zip
3、将解压目录文件中config/ik文件夹复制到ES安装目录config文件夹下。
4、因为是源代码,此处需要使用maven打包,进入解压文件夹中,执行命令:mvn clean package5、将打包得到的jar文件elasticsearch-analysis-ik-1.2.8-sources.jar复制到ES安装目录的lib目录下。
6、在ES的配置文件config/elasticsearch.yml中增加ik的配置,在最后增加:
alias: [ik_analyzer]
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
ik_max_word:
use_smart: false
use_smart: true或index.analysis.analyzer.ik.type : “ik”7、重新启动elasticsearch服务,这样就完成配置了,收入命令:curl -XPOST
&http://localhost:9200/userinfo/_analyze?analyzer=ik&pretty=true&text=我是中国人&测试结果如下:{
token: text
start_offset: 2
end_offset: 6
type: ENGLISH
position: 1
start_offset: 9
end_offset: 10
type: CN_CHAR
position: 2
token: 中国人
start_offset: 11
end_offset: 14
type: CN_WORD
position: 3
token: 中国
start_offset: 11
end_offset: 13
type: CN_WORD
position: 4
token: 国人
start_offset: 12
end_offset: 14
type: CN_WORD
position: 5
1、ES安装插件本来使用使用命令plugin来完成,但是我本机安装ik时一直不成功,所以就使用源代码打包安装了。
2、自定义词库的方式,请参考&
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:121654次
积分:1071
积分:1071
排名:千里之外
原创:30篇
(3)(1)(1)(2)(1)(2)(1)(1)(4)(1)(1)(1)(3)(4)(1)(1)(1)(1)
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'55502人阅读
elasticsearch
大数据(2)
云计算(1)
Elasticsearch默认提供的分词器,会把每个汉字分开,而不是我们想要的根据关键词来分词。例如:
curl -XPOST
&http://localhost:9200/userinfo/_analyze?analyzer=standard&pretty=true&text=我是中国人&我们会得到这样的结果:
token: text
start_offset: 2
end_offset: 6
type: &ALPHANUM&
position: 1
start_offset: 9
end_offset: 10
type: &IDEOGRAPHIC&
position: 2
start_offset: 10
end_offset: 11
type: &IDEOGRAPHIC&
position: 3
start_offset: 11
end_offset: 12
type: &IDEOGRAPHIC&
position: 4
start_offset: 12
end_offset: 13
type: &IDEOGRAPHIC&
position: 5
start_offset: 13
end_offset: 14
type: &IDEOGRAPHIC&
position: 6
}正常情况下,这不是我们想要的结果,比如我们更希望 “中国人”,“中国”,“我”这样的分词,这样我们就需要安装中文分词插件,ik就是实现这个功能的。
elasticsearch-analysis-ik
是一款中文的分词插件,支持自定义词库。
安装步骤:
1、到github网站下载源代码,网站地址为:
右侧下方有一个按钮“Download ZIP&,点击下载源代码elasticsearch-analysis-ik-master.zip。
2、解压文件elasticsearch-analysis-ik-master.zip,进入下载目录,执行命令:
unzip elasticsearch-analysis-ik-master.zip
3、将解压目录文件中config/ik文件夹复制到ES安装目录config文件夹下。
4、因为是源代码,此处需要使用maven打包,进入解压文件夹中,执行命令:mvn clean package5、将打包得到的jar文件elasticsearch-analysis-ik-1.2.8-sources.jar复制到ES安装目录的lib目录下。
6、在ES的配置文件config/elasticsearch.yml中增加ik的配置,在最后增加:
alias: [ik_analyzer]
type: org.elasticsearch.index.analysis.IkAnalyzerProvider
ik_max_word:
use_smart: false
use_smart: true或index.analysis.analyzer.ik.type : “ik”7、重新启动elasticsearch服务,这样就完成配置了,收入命令:curl -XPOST
&http://localhost:9200/userinfo/_analyze?analyzer=ik&pretty=true&text=我是中国人&测试结果如下:{
token: text
start_offset: 2
end_offset: 6
type: ENGLISH
position: 1
start_offset: 9
end_offset: 10
type: CN_CHAR
position: 2
token: 中国人
start_offset: 11
end_offset: 14
type: CN_WORD
position: 3
token: 中国
start_offset: 11
end_offset: 13
type: CN_WORD
position: 4
token: 国人
start_offset: 12
end_offset: 14
type: CN_WORD
position: 5
1、ES安装插件本来使用使用命令plugin来完成,但是我本机安装ik时一直不成功,所以就使用源代码打包安装了。
2、自定义词库的方式,请参考&
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:121656次
积分:1071
积分:1071
排名:千里之外
原创:30篇
(3)(1)(1)(2)(1)(2)(1)(1)(4)(1)(1)(1)(3)(4)(1)(1)(1)(1)
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'elasticsearch-ik配置以及使用文档_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
elasticsearch-ik配置以及使用文档
阅读已结束,下载文档到电脑
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,方便使用
还剩5页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢}

我要回帖

更多关于 honeyselect ik插件 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信