通过Es实现商品搜索功能

涉及微服务:
changgou_web_search:存放静态资源,实现页面跳转。
changgou_service_search:负责从ES查询数据。
changgou_service_search_api:放实体对象及feign接口。
(1)创建changgou_web_search工程
pom的引入(前端使用的是thymeleaf模板引擎)

<dependencies>
        <dependency>
            <groupId>com.changgou</groupId>
            <artifactId>changgou_common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.changgou</groupId>
            <artifactId>changgou_service_search_api</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <!--thymeleaf模板引擎-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
    </dependencies>

存放静态资源创建类:

Snipaste_2019-08-21_11-20-04.png

这里注意static与templates文件夹名必须这样起,不然需要配置,麻烦!

application.yml的配置:

server:
  port: 9011
spring:
  application:
    name: webSearch
  main:
    allow-bean-definition-overriding: true   #当遇到同样名字的时候,是否允许覆盖注册
  thymeleaf:
    cache: false #thymeleaf数据缓存关闭
eureka:
  client:
    service
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值