集成背景
elk或者快速搜索都要用到elasticsearch,源于他的速度非常快。如何采用最新的接口集成,下面就介绍一个样例。
代码示例
1. 加依赖
<properties>
<java.version>1.8</java.version>
<elastic.version>7.8.0</elastic.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId

本文介绍了如何在Springboot 2.3.2中集成Elasticsearch,包括添加依赖、编写Controller、Entity和Service代码,并提供了一个简单的测试DEMO,帮助初学者理解集成过程。
最低0.47元/天 解锁文章
10万+

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



