MCPcopy Index your code
hub / github.com/VanRoy/spring-data-jest

github.com/VanRoy/spring-data-jest @v3.3.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.3.4 ↗ · + Follow
447 symbols 1,815 edges 54 files 51 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Spring Data Jest

Apache License 2 Build Status Maven Central

Spring Data implementation for ElasticSearch based on Jest Rest client

Useful to use Spring Data with ElasticSearch cluster accessible only by HTTP ( for example on AWS).

Versions

spring data jest spring boot spring data elasticsearch jest elasticsearch
3.3.4.RELEASE 2.2.1 3.2.1.RELEASE 6.3.1 6.8.4
3.2.5.RELEASE 2.1.2 3.1.3.RELEASE 6.3.1 6.4.3
3.1.5.RELEASE 2.0.5 3.0.10.RELEASE 5.3.4 5.5.0
3.0.0.RELEASE 2.0.0.M4 3.0.0.RELEASE 5.3.2 5.5.0
2.3.1.RELEASE 1.5.x 2.1.0.RELEASE 2.0.4 2.4.4
2.2.0.RELEASE >= 1.4.3 2.0.6.RELEASE 2.0.4 2.4.3
2.1.4.RELEASE < 1.4.3 2.0.5.RELEASE 2.0.3 2.2.0
1.0.2.RELEASE 1.3.x 1.3.4.RELEASE 1.0.3 1.5.2

Quick Start with Spring Boot

Maven configuration

Add the Maven dependency:

<dependency>
    <groupId>com.github.vanroy</groupId>
    <artifactId>spring-boot-starter-data-jest</artifactId>
    <version>3.3.4.RELEASE</version>
</dependency>


<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
</dependency>

For specific case of AWS ES Domain (with Request Signing) add this dependency:

<dependency>
    <groupId>vc.inreach.aws</groupId>
    <artifactId>aws-signing-request-interceptor</artifactId>
    <version>0.0.21</version>
</dependency>

Application

@SpringBootApplication(exclude = {ElasticsearchAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class})
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Configuration ( application.yml )

spring:
    data:
        jest:
            uri: http://localhost:9200

            # Useful only for AWS request signing ( not required on EC2 instance, it's auto-discovered )
            aws-region: eu-west-1

Quick Start without Spring Boot

Maven configuration

Add the Maven dependency:

<dependency>
    <groupId>com.github.vanroy</groupId>
    <artifactId>spring-data-jest</artifactId>
    <version>3.3.4.RELEASE</version>
</dependency>


<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
</dependency>

XML Namespace

You can set up repository scanning via xml configuration, which will happily create your repositories.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:elasticsearch="http://www.springframework.org/schema/data/elasticsearch"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/data/elasticsearch http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch.xsd">


    <elasticsearch:node-client id="client" local="true" cluster-name="#{T(java.util.UUID).randomUUID().toString()}"
                               http-enabled="true" path-data="target/elasticsearchTestData" path-home="src/test/resources/test-home-dir"
                               path-configuration="node-client-configuration.yml"/>



    <bean id="jestClient" factory-bean="jestClientFactory" factory-method="getObject" destroy-method="close" />

    <bean id="jestClientConfigBuilder" class="io.searchbox.client.config.HttpClientConfig.Builder">
        <constructor-arg type="java.lang.String" value="http://localhost:9200"/>
    </bean>

    <bean id="jestClientConfig" factory-bean="jestClientConfigBuilder" factory-method="build"/>

    <bean id="jestClientFactory" class="io.searchbox.client.JestClientFactory">
        <property name="httpClientConfig" ref="jestClientConfig"/>
    </bean>


    <bean id="jestElasticsearchTemplate" class="com.github.vanroy.springdata.jest.JestElasticsearchTemplate">
        <constructor-arg ref="jestClient"/>
    </bean>

</beans>

Samples

Sample with Spring Boot and embedded Elasticsearch :

https://github.com/VanRoy/spring-data-jest/tree/master/spring-boot-sample-data-jest

Sample with Spring Boot and Elasticsearch on AWS (managed) :

https://github.com/VanRoy/spring-data-jest/tree/master/spring-boot-sample-data-jest-aws

Plugins loading

All plugins located in org.elasticsearch.plugin are loaded by default. All plugins located in packages specified in property spring.data.jest.pluginPackages are also loaded.

Example for Expression-lang

In pom.xml, add plugin dependency :

 <dependency>
   <groupId>org.codelibs.elasticsearch.module</groupId>
   <artifactId>lang-expression</artifactId>
   <version>...</version>
 </dependency>

In application.yml, add following :

spring:
    data:
        jest:
            pluginPackages: org.elasticsearch.script.expression

Sponsors

JetBrains

JetBrains

JetBrains supports our open source project by sponsoring a All Products Packs within their Free Open Source License program.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 384
Class 52
Interface 11

Languages

Java100%

Modules by API surface

spring-data-jest/src/test/java/com/github/vanroy/springdata/jest/JestElasticsearchTemplateTests.java95 symbols
spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/JestElasticsearchTemplate.java71 symbols
spring-boot-starter-data-jest/src/main/java/com/github/vanroy/springboot/autoconfigure/data/jest/ElasticsearchJestProperties.java34 symbols
spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/MappingBuilder.java20 symbols
spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/internal/SearchScrollResult.java16 symbols
spring-data-jest/src/test/java/com/github/vanroy/springdata/jest/entities/ArticleEntity.java14 symbols
spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/mapper/DefaultJestResultsMapper.java10 symbols
spring-data-jest/src/test/java/com/github/vanroy/springdata/jest/entities/ArticleEntityBuilder.java9 symbols
spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/CriteriaFilterProcessor.java9 symbols
spring-boot-sample-data-jest/src/main/java/sample/data/jest/Customer.java9 symbols
spring-boot-sample-data-jest-aws/src/main/java/sample/data/jest/aws/Customer.java9 symbols
spring-data-jest/src/test/java/com/github/vanroy/springdata/jest/entities/SampleMappingEntity.java8 symbols

For agents

$ claude mcp add spring-data-jest \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page