- 官网下载elasticsearch7.5 解压后双击就能启动

- 修改配置elasticsearch config
添加如下配置
http.cors.enabled: true
http.cors.allow-origin: "*"
重启es

- Ik中文分词插件 https://github.com/medcl/elasticsearch-analysis-ik
-
Release下载 https://github.com/medcl/elasticsearch-analysis-ik/releases 请下载与elasticsearch对应版本
-

-
创建映射,指定该字段使用ik分词 请在同步索引前创建 不然会报错字段已存在
具体见官方文档
Analyzer:
ik_smart,ik_max_word,Tokenizer:
ik_smart,ik_max_word -
{ "mappings": { "properties": { "productName": { "type": "text", "analyzer": "ik_max_word", "search_analyzer": "ik_max_word" } } } }
分词效果对比 官方默认standard或chinese
{ "analyzer": "ik_max_word", "text": "感谢支持优快云的BLOG" }
推荐阅读 https://blog.youkuaiyun.com/zy5757/article/details/77605945
本文介绍如何下载并配置Elasticsearch 7.5,包括启动服务、修改配置文件以启用跨域请求,以及安装和使用IK中文分词插件的过程。同时,提供了创建映射时指定使用IK分词器的方法,以及与标准分词器的效果对比。
504

被折叠的 条评论
为什么被折叠?



