SpringBoot整合Elasticsearch详细教程

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.RELEASE</version>
    <relativePath />
</parent>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!-- elasticsearch-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>
</dependencies>

application.yml

spring:
  data:
    elasticsearch:
      ####集群名称
      cluster-name: myes
      ####地址
      cluster-nodes: 192.168.78.131:9300
Last modification:June 21st, 2019 at 12:26 am
如果觉得这篇技术文章对你有用,请随意赞赏

Leave a Comment