Elasticsearch5.5.1安装IK中文分词器
来源:互联网 发布:淘宝虚拟网店要不要钱 编辑:程序博客网 时间:2024/06/06 08:55
安装步骤:
一、参照官方文档安装IK分词器
1、直接到https://github.com/medcl/elasticsearch-analysis-ik/releases下载对应版本zip包
解压到elasticsearch的plugin目录下
unzip elasticsearch-analysis-ik-5.5.1.zip
2、使用elasticsearch-plugin命令安装
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.5.1/elasticsearch-analysis-ik-5.5.1.zip
重新启动elasticsearch
systemctl restart elasticsearch.service
测试一下:
1、创建索引
curl -XPUT http://localhost:9200/index
2、创建一个映射
curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'
{
"properties": {
"content": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
}
}
}'
3、创建文档
curl -XPOST http://localhost:9200/index/fulltext/1 -d'
{"content":"中国驻洛杉矶领事馆遭亚裔男子枪击 嫌犯已自首"}’
curl -XPOST http://localhost:9200/index/fulltext/2 -d'
{"content":"中韩渔警冲突调查:韩警平均每天扣1艘中国渔船"}’curl -XPOST 192.168.1.156:9200/test_index/fulltext/3 -d'
{"content":"公安部:各地校车将享最高路权"}’
4、查询
curl -XPOST 192.168.1.156:9200/test_index/fulltext/_search -d'
{
"query" : { "match" : { "content" : "中国" }},
"highlight" : {
"pre_tags" : ["<tag1>", "<tag2>"],
"post_tags" : ["</tag1>", "</tag2>"],
"fields" : {
"content" : {}
}
}
}’
查询结果如下:
{
- "took": 91,
- "timed_out": false,
参考资料:
官方文档:https://github.com/medcl/elasticsearch-analysis-ik
- Elasticsearch5.5.1安装IK中文分词器
- ElasticSearch5中文分词(IK)
- elasticsearch5.4 ik分词器插件安装
- Elasticsearch5.6.0安装ik分词器
- ElasticSearch5.3安装IK分词器
- ElasticSearch5.0——中文分词插件IK安装
- ElasticSearch5.3安装IK分词器并验证
- ElasticSearch5.3安装IK分词器并验证
- Elasticsearch5.x安装IK分词器以及热词配置
- Elasticsearch5.4.0 IK分词插件安装详解
- Elasticsearch5.X 搜索引擎框架 安装配置及analysis-ik中文分词插件安装
- ElasticSearch5.X IK分词器使用
- Solr4.2安装IK中文分词器
- elasticsearch中文分词器IK安装
- ElasticSearch IK中文分词器安装
- elasticsearch5.5.2手动创建索引并配置ik中文分词器
- ElasticSearch5.4.3 环境搭建 2017 (6-IK中文分词插件)
- ElasticSearch中文分词ik安装
- javascript中三大弹出框alert(),confirm(), prompt() 的应用和区别
- 网站开发(十五)文章分页技术
- repo/git提交代码
- 【Android开发笔记】仿微信支付密码
- static、final修饰符、内部类和Java内存分配
- Elasticsearch5.5.1安装IK中文分词器
- pip install错误
- json_decode第二个参数要TRUE~~~~
- UILable通过drawTextInRect修改文字间距
- 读书笔记_算法第四版(一)
- ThinkPHP3.2.3验证码显示、刷新、校验
- U2F协议解析
- 概率统计——五数概括法
- Caused by :java.lang.reflect.InvocationTargetException和Binary XML file line #**错误记录