springboot 使用elasticsearch-rest-high-level-client操作 es

https://mp.weixin.qq.com/s/fgi6Xd1Xbs4RJSDGBRcZxQ

https://mp.weixin.qq.com/s/ug2w0aOw_XPqILMJZkrssA

es7.x以上的版本引用了6.8的elasticsearch-rest-client包会出现java.lang.ClassNotFoundException: org.elasticsearch.client.Cancellable

需要将其exclude,引入7.x版本的。

implementation('org.elasticsearch.client:elasticsearch-rest-high-level-client:7.12.1') {
    exclude group: 'org.elasticsearch.client', module: 'elasticsearch-rest-client'
}
implementation 'org.elasticsearch:elasticsearch:7.12.1'
implementation 'org.elasticsearch.client:elasticsearch-rest-client:7.12.1'

 

posted @ 2021-06-15 17:19  java渣渣  阅读(802)  评论(0编辑  收藏  举报