zoukankan      html  css  js  c++  java
  • Springboot整合Elasticsearch的配置文件

    记录一下Elasticsearch结合Springboot项目的配置文件,免得忘记了又要采坑

    一、application.yml

    spring:
      data:
        elasticsearch:
          cluster-name: my-application
          cluster-nodes: 127.0.0.1:9300
          repositories:
            enabled: true
    
    http.cors.enabled: true
    http.cors.allow-origin: "*"

    二、pom.xml

    <?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.2.6.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>com.blb</groupId>
        <artifactId>datasearch</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <name>datasearch</name>
        <description>Demo project for Spring Boot</description>
    
        <properties>
            <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-web</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <scope>runtime</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <optional>true</optional>
            </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>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    
    </project>
  • 相关阅读:
    金山快盘的登录提醒
    排列到随机, 到随机选择,对于植物模拟世界 混沌
    转载 多层影藏 和显示
    庆生写的东西
    布料修改器的用法。
    像素相关
    模拟c++ 控件
    侧his
    输出文件
    win7 xp 删除一些 顽固的自动项目
  • 原文地址:https://www.cnblogs.com/theyang/p/12802044.html
Copyright © 2011-2022 走看看