前言
Elasticsearch搜索引擎整合SpringBoot,官方的RestClient,封装了ES操作,API层次分明,上手简单。此处为Elasticsearch-Rest-Client在实际项目中的一种应用。
本文章建立在Elasticsearch-Rest-Client整合springboot的前提下
Elasticsearch-Rest-Client整合springboot
一、feign服务调用(cloud使用,boot项目直接忽略)
此处搜索引擎的搜索对象为商品,在SpringCloud中需使用服务调用来调用商品模块的方法
1.引入依赖
service模块中引入依赖
<!--服务调用-->
<dependency>
<groupId>org.springframework.cloud</groupId>