文檔
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/94013059,https://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創建索引;