1.引入相关依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.3.4.RELEASE</version>
</dependency>
//提供getset 让代码更加简洁
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
//mybatis 提供分页
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.3.0</version>
</dependency>
2.yml配置
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/nsbdcms?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
data:
elasticsearch:
cluster-name: es-Cluster
cluster-nodes: 192.168.126.128:9200
repositories:
enabled: true
es:
url: 192.168.126.128:9200
index: sougoulog
#mybatis plus 设置
mybatis-plus:
type-aliases-package: com.example.jsoupdome.domin
mapper-locations: classpath:mapper/*.xml
configuration:
jdbc-type-for-null: null
global-config:
# 关闭 mybatis-plus的 ba


6690

被折叠的 条评论
为什么被折叠?



