springboot2.0.6 整合 elasticsearch 6.3.0 环境搭建
pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.xsq.elasticsearch</groupId>
<artifactId>xsq-elasticsearch</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>xsq-elasticsearch</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
yml
spring:
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: 192.168.101.101:9300
代码地址gitee:码云仓库地址
本文详细介绍如何使用SpringBoot 2.0.6版本整合Elasticsearch 6.3.0,包括Maven配置、YAML配置以及环境搭建步骤。项目代码已托管于码云仓库。
718

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



