Spring Data Jest Plus

Custom implementation for Spring Data Jest

License

License

Categories

Categories

Data Jest Databases
GroupId

GroupId

com.github.spt-oss
ArtifactId

ArtifactId

spring-data-jest-parent
Last Version

Last Version

3.1.5.0
Release Date

Release Date

Type

Type

pom
Description

Description

Spring Data Jest Plus
Custom implementation for Spring Data Jest
Project URL

Project URL

https://github.com/spt-oss/spring-data-jest-plus
Project Organization

Project Organization

SPT
Source Code Management

Source Code Management

https://github.com/spt-oss/spring-data-jest-plus/tree/master

Download spring-data-jest-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.spt-oss/spring-data-jest-parent/ -->
<dependency>
    <groupId>com.github.spt-oss</groupId>
    <artifactId>spring-data-jest-parent</artifactId>
    <version>3.1.5.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.spt-oss/spring-data-jest-parent/
implementation 'com.github.spt-oss:spring-data-jest-parent:3.1.5.0'
// https://jarcasting.com/artifacts/com.github.spt-oss/spring-data-jest-parent/
implementation ("com.github.spt-oss:spring-data-jest-parent:3.1.5.0")
'com.github.spt-oss:spring-data-jest-parent:pom:3.1.5.0'
<dependency org="com.github.spt-oss" name="spring-data-jest-parent" rev="3.1.5.0">
  <artifact name="spring-data-jest-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.spt-oss', module='spring-data-jest-parent', version='3.1.5.0')
)
libraryDependencies += "com.github.spt-oss" % "spring-data-jest-parent" % "3.1.5.0"
[com.github.spt-oss/spring-data-jest-parent "3.1.5.0"]

Dependencies

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.4

Project Modules

  • spring-boot-starter-data-jest

Spring Data Jest Plus

circleci maven central javadoc

  • Custom implementation for Spring Data Jest
  • Note: This project is unofficial and experimental.

Dependencies

  • com.github.spt-oss:spring-boot-starter-data-jest:3.1.5.0
    • com.github.vanroy:spring-boot-starter-data-jest:3.1.5.RELEASE
    • vc.inreach.aws:aws-signing-request-interceptor:0.0.22
    • org.elasticsearch:elasticsearch:5.6.12
    • org.springframework.boot:spring-boot-starter-json:2.0.6.RELEASE
    • org.springframework.cloud:spring-cloud-aws-autoconfigure:2.0.1.RELEASE
    • org.springframework.data:spring-data-elasticsearch:3.0.11.RELEASE
    • ......
  • com.github.spt-oss:spring-boot-starter-data-jest:3.1.5.1
    • org.elasticsearch:elasticsearch:5.6.14
    • org.springframework.boot:spring-boot-starter-json:2.0.7.RELEASE
    • org.springframework.data:spring-data-elasticsearch:3.0.12.RELEASE
    • ......

Usage

Use with Spring Boot and Amazon Elasticsearch Service

  1. Add a dependency in your project.

    <dependency>
        <groupId>com.github.spt-oss</groupId>
        <artifactId>spring-boot-starter-data-jest</artifactId>
        <version>3.1.5.1</version>
    </dependency>
  2. Add AWS settings to your application properties.

    spring.data.jest:
        uri: https://search-XXXXX-XXXXX.us-west-1.es.amazonaws.com/
    
    cloud.aws:
        credentials:
            accessKey: ABCDEFGHIJKLMNOPQRST
            secretKey: ABc1d2EfGhIjkLMnOpqRS3+tuVwXYzabCDeFGh4i
        region:
            auto: false
            static: us-west-1
  3. Setup Document and Repository for your project.

    import org.springframework.data.annotation.Id;
    import org.springframework.data.elasticsearch.annotations.Document;
    import org.springframework.data.elasticsearch.annotations.Mapping;
    import org.springframework.data.elasticsearch.annotations.Setting;
    
    import lombok.Data;
    
    @Document(indexName = "foo", type = "product", createIndex = false)
    @Setting(settingPath = "/path/to/settings.json")
    @Mapping(mappingPath = "/path/to/mappings/product.json")
    @Data
    public class Product {
        
        @Id
        private String id;
        
        private String content;
    }
    import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
    import org.springframework.stereotype.Repository;
    
    @Repository
    public interface ProductRepository extends ElasticsearchRepository<Product, String> {
    }
  4. Setup Elasticsearch Configuration.

    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
    import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
    
    import com.fasterxml.jackson.databind.PropertyNamingStrategy;
    import com.github.vanroy.springboot.autoconfigure.data.jest.CustomElasticsearchJestDataAutoConfiguration.JestObjectMapperCustomizer;
    
    @Configuration
    @EnableElasticsearchRepositories(basePackageClasses = ProductRepository.class)
    public class MyElasticsearchConfiguration {
        
        @Bean
        public JestObjectMapperCustomizer jestObjectMapperCustomizer() {
            
            return mapper -> mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
        }
    }
  5. Run the application.

License

  • This software is released under the Apache License 2.0.
com.github.spt-oss

SPT

Open Source Libraries for Java

Versions

Version
3.1.5.0