ElasticSearch

文档

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html

概述

ES是一个搜索系统,几乎是应用必须的中间件;仅使用MySQL进行数据搜索是不可行的;ES可以看作是一个数据库;

ES介绍:https://blog.csdn.net/paicmis/article/details/82535018

ES介绍,名词解释等(ES结构,元数据),https://blog.csdn.net/zhenwei1994/article/details/94013059https://blog.csdn.net/nanchengyu/article/details/86691635

ES、MySQL对比:https://blog.csdn.net/roshy/article/details/89307570

安装ES、ES-head、ik分词器、SpringBoot整合Spring data ES、首个案例

https://blog.csdn.net/weixin_42633131/article/details/82902812

https://blog.csdn.net/const_qiu/article/details/89429111

https://www.cnblogs.com/Alandre/p/11386178.html

https://blog.csdn.net/chen_2890/article/details/83757022

https://www.bbsmax.com/A/x9J2DKRjd6/

启动ES

进入ES的bin目录,双击ES.bat;

启动ES-head

进入ES-head目录,npm run start;

遇到的问题

提示不是内部或外部命令:cmd文件所在目录的路径加到环境变量系统变量Path中;

启动ES报错:查看elasticsearch.yml文件;

启动ES-head报错:https://blog.csdn.net/qq_39941165/article/details/103664428,也有可能是ES的yml文件配置错误导致;

启动SpringBoot报错(springBoot作为一个操作ES的客户端),说:加载ES节点失败,没有可用的ES节点,这是因为ES7版本后不支持TransportClient,TransportClient已经弃用了,也就是说这种ES客户端不让用了,我是ES-7.5.1,换个客户端(换一套jar包,换一套集成方式);

SpringBoot整合ES及使用

见heal项目;

都是用spring data elasticsearch;

https://segmentfault.com/a/1190000018625101?utm_source=tag-newest

https://blog.csdn.net/chen_2890/article/details/83895646

https://my.oschina.net/u/2862573/blog/2052284

https://www.cnblogs.com/qdhxhz/p/9521065.html

ES-head使用操作

复合查询:

索引名/_mapping?pretty,查询ES元数据信息;

_search,查询所有数据;

索引名/类型名/ POST,新增数据,自动生成_id;

索引名/类型名/_search,查询数据;

索引名/类型名/id,删除这条数据;

索引名/类型名/_id/_update/ POST {"doc":{"city":"哈尔滨市#齐齐哈尔市#"}},修改数据;

新增字段:https://www.jianshu.com/p/41bdb09a5bc2

全文检索模块功能(我的目的)

数据写入mysql,读取/搜索时查ES中的数据(读写分离:实现方式1:二者配置主从同步,方式2:动态代理。还是说增删改查都ES);

MySQL数据同步到ES中;

使用Java Rest高级别客户端,为ES创建索引;

原文地址:https://www.cnblogs.com/yyjh/p/12093304.html