From 8aa90425a73a53472a4225c1773dc09b873e9cab Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 Jan 2026 15:27:00 +0100 Subject: [PATCH] Add Readme templates. See spring-projects/spring-data-build#2758 --- .github/README.template.adoc | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/README.template.adoc diff --git a/.github/README.template.adoc b/.github/README.template.adoc new file mode 100644 index 000000000..ec6504818 --- /dev/null +++ b/.github/README.template.adoc @@ -0,0 +1,83 @@ += Spring Data for Elasticsearch image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-elasticsearch%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-elasticsearch/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]] image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data Elasticsearch"] + +The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services. + +The Spring Data Elasticsearch project provides integration with the https://www.elastic.co/[Elasticsearch] search engine. +Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with Elasticsearch Documents and easily writing a Repository style data access layer. + +This project is lead and maintained by the community. + +== Features + +* Spring configuration support using Java based `@Configuration` classes or an XML namespace for an ES client instances. +* `ElasticsearchOperations` class and implementations that increases productivity performing common ES operations. +Includes integrated object mapping between documents and POJOs. +* Feature Rich Object Mapping integrated with Spring’s Conversion Service +* Annotation based mapping metadata +* Automatic implementation of `Repository` interfaces including support for custom search methods. +* CDI support for repositories + +include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/code-of-conduct.adoc[] + +== Getting Started + +Here is a quick teaser of an application using Spring Data Repositories in Java: + +[source,java] +---- +public interface PersonRepository extends CrudRepository { + + List findByLastname(String lastname); + + List findByFirstnameLike(String firstname); +} + +@Service +public class MyService { + + private final PersonRepository repository; + + public MyService(PersonRepository repository) { + this.repository = repository; + } + + public void doWork() { + + repository.deleteAll(); + + Person person = new Person(); + person.setFirstname("Oliver"); + person.setLastname("Gierke"); + repository.save(person); + + List lastNameResults = repository.findByLastname("Gierke"); + List firstNameResults = repository.findByFirstnameLike("Oli"); + } +} +---- + +=== Using the RestClient + +Please check the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration[official documentation]. + +include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/dependencies.adoc[] + +**Compatibility Matrix** + +The compatibility between Spring Data Elasticsearch, Elasticsearch client drivers and Spring Boot versions can be found in the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#preface.versions[reference documentation]. + +To use the Release candidate versions of the upcoming major version, use our Maven milestone repository and declare the appropriate dependency version: + +[source,xml] +---- + + org.springframework.data + spring-data-elasticsearch + ${version}.RCx + +---- + +include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/getting-help.adoc[] + +include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/license.adoc[] +