Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring elasticsearch 7.8.0 #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions Dockerfile.sh

This file was deleted.

37 changes: 8 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,27 @@
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.fablen</groupId>
<artifactId>spring-elasticsearch</artifactId>
<artifactId>spring-elasticsearch-7.8.0</artifactId>
<version>1.0.0</version>
<name>spring-elasticsearch</name>
<name>spring-elasticsearch-7.8.0</name>
<description>Elasticsearch 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>
<elasticsearch.version>7.6.2</elasticsearch.version>
<ch.qos.logback.version>1.2.3</ch.qos.logback.version>
<java.version>11</java.version>
<elasticsearch.version>7.8.0</elasticsearch.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.72</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>${ch.qos.logback.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.logstash.logback/logstash-logback-encoder -->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.fablen.elasticsearch.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* <p>
* Description:
* </p>
*
* @author ZhangBaoSheng
* @version v1.0.0
*/
@Configuration
public class ElasticSearchConfig {
@Bean
public RestHighLevelClient restHighLevelClient() {
return new RestHighLevelClient(
RestClient.builder(
new HttpHost("122.152.213.179", 9200, "http")
)
);
}
}

This file was deleted.

23 changes: 16 additions & 7 deletions src/main/java/com/fablen/elasticsearch/entity/Book.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
package com.fablen.elasticsearch.entity;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

/**
* @author zhangbaosheng
* <p>
* Description:
* </p>
*
* @author ZhangBaoSheng
* @version v1.0.0
*/
@Data
@Document(indexName = "index_book")
public class Book {
@Field
private int id;
private String name;
private String bookName;
private int bookPrice;

public Book() {
}

public Book(String name, int price) {
this.bookName = name;
this.bookPrice = price;
}
}

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
spring.application.name= ELASTICSEARCH-TEST
server.port= 8080

server.port= 8080
38 changes: 0 additions & 38 deletions src/main/resources/logback-spring.xml

This file was deleted.

Loading