Toggle navigation
菜菜小站
菜菜小站
前端开发
前端开发
前端基础
bootstrap
JavaScript
微信小程序
后端开发
后端开发
php开发
laravel
数据库
编辑器
git
微信开发
服务器
服务器
https
cos云存储
ubuntu
homestead
go
ContactMe
Mac安装elasticsearch、ik分词、分词热更新配置
作者:
菜菜子
|
时间:2019-05-24 21:18:00 |
分类:
后端开发
,
数据库
|
访问: 2,283 次|
评论:
2 评论
# elasticsearch需要java安装环境 * brew cask install homebrew/cask-versions/adoptopenjdk8 # 安装elasticsearch及启动 * brew install elasticsearch@6.8.0 * brew services start elasticsearch@6.8.0 # 测试是否成功启动(启动后大概五秒后执行) * curl localhost:9200 ``` { "name" : "Ja66PI6", "cluster_name" : "elasticsearch_xxxx", "cluster_uuid" : "HP0FAtbCTtSnpbNvgG9cyQ", "version" : { "number" : "6.8.0", "build_flavor" : "oss", "build_type" : "tar", "build_hash" : "65b6179", "build_date" : "2019-05-15T20:06:13.172855Z", "build_snapshot" : false, "lucene_version" : "7.7.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" } ``` # ik分词版本要与elasticsearch版本对应 如果elasticsearch是6.8.0,ik分词也必须是6.8.0 安装ik分词 > elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.8.0/elasticsearch-analysis-ik-6.8.0.zip # 查看状态 * brew services list # 启动/重启/停止 * brew services start elasticsearch * brew services restart elasticsearch * brew services stop elasticsearch ## 测试ik分词 ### 创建index索引 * curl -XPUT "http://127.0.0.1:9200/index?pretty" ### 测试是否分词成功 ``` curl 'http://localhost:9200/index/_analyze?pretty=true' -H 'Content-Type: application/json' -d '{ "analyzer":"ik_max_word", "text":"这里是好记性不如烂笔头感叹号的博客们"}' ``` ## 分词热更新 elasticsearch信息找到Config参数: > brew info elasticsearch 找到文件 > /usr/local/etc/elasticsearch/analysis-ik/IKAnalyzer.cfg.xml ```xml
IK Analyzer 扩展配置
http://xxx.com/xxxxxxx.txt
http://xxx.com/xxx.txt
``` 在remote_ext_dict中填入的地址中填写一个txt文本地址,每个词换一行,stop先停止,start在开启(不要用restart!) **注意:修改了remote_ext_dict中的参数后不要使用brew services restart elasticsearch重启elasticsearch,这样重启不会重新去取远程文件位置,需要先stop后start** 参考文章: http://blog.51yip.com/server/1892.html https://blog.csdn.net/github_26672553/article/details/71080286
标签:
elasticsearch
已有 2 条评论
添加新评论
昵称(必填)
邮箱(必填)
网站(选填)
内容(必填)
提交评论
最新文章
部署go项目
lumen多个项目共用代码
lumen >=5.8中使用pusher广播
nginx负载均衡配置(二)
nginx负载均衡配置(一)
laravel中redis发布订阅相关问题处理
mysql 主从备份(一)
最新回复
DeWjjj: 兄弟很好使,奥力给!
懒猫爱伸腰: 大佬,问题我解决了,就加了一行代码 把ap-nanj...
懒猫爱伸腰: 大佬,啥会儿更新一下,现在又南京的桶了。。。。。
菜菜子: https://laravel-admin.org/d...
庆: laravel-admin 中图片上传如何限制图片尺寸...
惹我: 123
zhwangart: 感谢作者分享,这个问题简直烦死个人!终于解决~
世界和平: 大佬,可以加一个压缩图片后再上传到OSS的功能吗?我看...
拾一: 大部分文件上传都是转圈圈。。一直提示不成功
时年: 好了好了,多谢
标签
bootstrap
前端框架
laravel5
laravel
laravel-admin
gd库
微信小程序
表单
https
git
mysql
wamp配置
ajax
cos小工具
cos
cos插件
微信支付
swoole
redis
邮件发送
腾讯云
sql语言
jwt
typecho
数组
破解
编辑器
ubuntu
elasticsearch
vue
homestead
linux
websocket
nginx
docker
负载均衡
标签
刷新
加密处理
验证码
悬浮框
权限控制
markdown
shell
ui
任务调度
定时任务
deployer
gogs
反向代理
go
ftp
测试
分页
队列
微信公众号
日志
wnmp
vagrant
无限极分类
分销
集合
supervisor
部署
grid
python
chunk
api管理工具
oss
缓存
pusher
laravel-push
归档
2020年11月
2020年07月
2020年05月
2020年01月
2019年12月
2019年11月
2019年10月
2019年09月
2019年08月
2019年07月
2019年06月
2019年05月
2019年03月
2019年01月
2018年12月
2018年11月
2018年10月
2018年09月
2018年08月
2018年07月
2018年06月
2018年05月
2018年04月
2018年03月
2017年09月
2017年06月
2017年05月
2017年04月
2017年03月
2017年02月
2017年01月
2016年12月
2016年11月
友情链接
空
//