diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 9f39d05501..dcfaafad58 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,3 +1,3 @@
-#Thu Apr 06 16:16:37 CEST 2023
+#Thu Dec 14 08:37:40 CET 2023
wrapperUrl=https\://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
-distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
+distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
diff --git a/Jenkinsfile b/Jenkinsfile
index a4cf17560a..8692547315 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -9,7 +9,7 @@ pipeline {
triggers {
pollSCM 'H/10 * * * *'
- upstream(upstreamProjects: "spring-data-commons/main", threshold: hudson.model.Result.SUCCESS)
+ upstream(upstreamProjects: "spring-data-commons/3.1.x", threshold: hudson.model.Result.SUCCESS)
}
options {
@@ -37,9 +37,11 @@ pipeline {
steps {
script {
- docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
- sh 'PROFILE=none ci/verify.sh'
- sh "ci/clean.sh"
+ docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
+ docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
+ sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh"
+ sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh"
+ }
}
}
}
@@ -64,9 +66,11 @@ pipeline {
}
steps {
script {
- docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) {
- sh 'PROFILE=none ci/verify.sh'
- sh "ci/clean.sh"
+ docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
+ docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) {
+ sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh"
+ sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh"
+ }
}
}
}
@@ -86,22 +90,23 @@ pipeline {
label 'data'
}
options { timeout(time: 20, unit: 'MINUTES') }
-
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
}
-
steps {
script {
- docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
- sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root ' +
- '-Dartifactory.server=https://repo.spring.io ' +
- "-Dartifactory.username=${ARTIFACTORY_USR} " +
- "-Dartifactory.password=${ARTIFACTORY_PSW} " +
- "-Dartifactory.staging-repository=libs-snapshot-local " +
- "-Dartifactory.build-name=spring-data-elasticsearch " +
- "-Dartifactory.build-number=${BUILD_NUMBER} " +
- '-Dmaven.test.skip=true clean deploy -U -B'
+ docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
+ docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
+ sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
+ "./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root " +
+ "-Dartifactory.server=${p['artifactory.url']} " +
+ "-Dartifactory.username=${ARTIFACTORY_USR} " +
+ "-Dartifactory.password=${ARTIFACTORY_PSW} " +
+ "-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " +
+ "-Dartifactory.build-name=spring-data-elasticsearch " +
+ "-Dartifactory.build-number=spring-data-elasticsearch-${BRANCH_NAME}-build-${BUILD_NUMBER} " +
+ "-Dmaven.test.skip=true clean deploy -U -B"
+ }
}
}
}
@@ -111,10 +116,6 @@ pipeline {
post {
changed {
script {
- slackSend(
- color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
- channel: '#spring-data-dev',
- message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
emailext(
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
mimeType: 'text/html',
diff --git a/README.adoc b/README.adoc
index c55a808007..f0d6c86039 100644
--- a/README.adoc
+++ b/README.adoc
@@ -137,9 +137,9 @@ To use the Release candidate versions of the upcoming major version, use our Mav
- spring-libs-snapshot
+ spring-snapshotSpring Snapshot Repository
- https://repo.spring.io/libs-milestone
+ https://repo.spring.io/milestone
----
@@ -154,9 +154,9 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
- spring-libs-snapshot
+ spring-snapshotSpring Snapshot Repository
- https://repo.spring.io/libs-snapshot
+ https://repo.spring.io/snapshot
----
diff --git a/ci/clean.sh b/ci/clean.sh
index e78b1e148c..6ddbf1b4b5 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -2,5 +2,7 @@
set -euo pipefail
-MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \
+export JENKINS_USER=${JENKINS_USER_NAME}
+
+MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
./mvnw -s settings.xml clean -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch
diff --git a/ci/pipeline.properties b/ci/pipeline.properties
index 2f45263dbc..62e60e6aa5 100644
--- a/ci/pipeline.properties
+++ b/ci/pipeline.properties
@@ -1,21 +1,22 @@
# Java versions
-java.main.tag=17.0.6_10-jdk-focal
+java.main.tag=17.0.9_9-jdk-focal
java.next.tag=20-jdk-jammy
# Docker container images - standard
-docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.main.tag}
-docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.next.tag}
+docker.java.main.image=library/eclipse-temurin:${java.main.tag}
+docker.java.next.image=library/eclipse-temurin:${java.next.tag}
# Supported versions of MongoDB
-docker.mongodb.4.4.version=4.4.18
-docker.mongodb.5.0.version=5.0.14
-docker.mongodb.6.0.version=6.0.4
+docker.mongodb.4.4.version=4.4.25
+docker.mongodb.5.0.version=5.0.21
+docker.mongodb.6.0.version=6.0.10
# Supported versions of Redis
-docker.redis.6.version=6.2.10
+docker.redis.6.version=6.2.13
+docker.redis.7.version=7.2.4
# Supported versions of Cassandra
-docker.cassandra.3.version=3.11.14
+docker.cassandra.3.version=3.11.16
# Docker environment settings
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home
@@ -24,4 +25,9 @@ docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -
# Credentials
docker.registry=
docker.credentials=hub.docker.com-springbuildmaster
+docker.proxy.registry=https://docker-hub.usw1.packages.broadcom.com
+docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token
artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c
+artifactory.url=https://repo.spring.io
+artifactory.repository.snapshot=libs-snapshot-local
+jenkins.user.name=spring-builds+jenkins
diff --git a/ci/verify.sh b/ci/verify.sh
index e3ea308624..594c857975 100755
--- a/ci/verify.sh
+++ b/ci/verify.sh
@@ -5,6 +5,8 @@ set -euo pipefail
mkdir -p /tmp/jenkins-home/.m2/spring-data-elasticsearch
chown -R 1001:1001 .
-MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \
+export JENKINS_USER=${JENKINS_USER_NAME}
+
+MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
./mvnw -s settings.xml \
- -P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch
\ No newline at end of file
+ -P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch
diff --git a/pom.xml b/pom.xml
index 219abe9837..b94528c885 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,486 +1,483 @@
- 4.0.0
-
- org.springframework.data
- spring-data-elasticsearch
- 5.1.0
-
-
- org.springframework.data.build
- spring-data-parent
- 3.1.0
-
-
- Spring Data Elasticsearch
- Spring Data Implementation for Elasticsearch
+ 4.0.0
+
+ org.springframework.data
+ spring-data-elasticsearch
+ 5.1.13-SNAPSHOT
+
+
+ org.springframework.data.build
+ spring-data-parent
+ 3.1.13-SNAPSHOT
+
+
+ Spring Data Elasticsearch
+ Spring Data Implementation for Elasticsearch
+ https://github.com/spring-projects/spring-data-elasticsearch
+
+
+ 3.1.13-SNAPSHOT
+
+
+ 7.17.15
+
+ 8.7.1
+
+ 2.18.0
+
+ 4.1.107.Final
+
+ 1.0.8.RELEASE
+ 0.14.4
+ 1.5.1
+ 1.18.0
+ 2.35.0
+
+ spring.data.elasticsearch
+
+
+ test
+ integration-test
+
+
+
+
+ biomedcentral
+ BioMed Central Development Team
+ +0
+
+
+ cstrobl
+ Christoph Strobl
+ cstrobl at pivotal.io
+ Pivotal
+ https://www.pivotal.io
+
+ Developer
+
+ +1
+
+
+ mpaluch
+ Mark Paluch
+ mpaluch at pivotal.io
+ Pivotal
+ https://www.pivotal.io
+
+ Developer
+
+ +1
+
+
+
+ https://github.com/spring-projects/spring-data-elasticsearch
-
-
- 3.1.0
-
-
- 7.17.9
-
- 8.7.0
-
- 2.18.0
-
- 4.1.90.Final
-
- 1.0.8.RELEASE
- 0.14.4
- 1.5.1
- 1.18.0
- 2.35.0
-
- spring.data.elasticsearch
-
-
- test
- integration-test
-
-
-
-
- biomedcentral
- BioMed Central Development Team
- +0
-
-
- cstrobl
- Christoph Strobl
- cstrobl at pivotal.io
- Pivotal
- https://www.pivotal.io
-
- Developer
-
- +1
-
-
- mpaluch
- Mark Paluch
- mpaluch at pivotal.io
- Pivotal
- https://www.pivotal.io
-
- Developer
-
- +1
-
-
-
-
- https://github.com/spring-projects/spring-data-elasticsearch
- scm:git:git://github.com/spring-projects/spring-data-elasticsearch.git
- scm:git:ssh://git@github.com/spring-projects/spring-data-elasticsearch.git
-
-
-
-
- Bamboo
- https://build.spring.io/browse/SPRINGDATAES
-
-
-
- GitHub
- https://github.com/spring-projects/spring-data-elasticsearch/issues
-
-
-
-
-
- io.netty
- netty-bom
- ${netty}
- pom
- import
-
-
-
-
+ scm:git:git://github.com/spring-projects/spring-data-elasticsearch.git
+ scm:git:ssh://git@github.com/spring-projects/spring-data-elasticsearch.git
+
+
+
+
+ Bamboo
+ https://build.spring.io/browse/SPRINGDATAES
+
+
+
+ GitHub
+ https://github.com/spring-projects/spring-data-elasticsearch/issues
+
+
+
-
-
-
- org.springframework
- spring-context
-
-
-
- org.springframework
- spring-tx
-
-
-
-
- org.springframework.data
- spring-data-commons
- ${springdata.commons}
-
-
-
-
- org.springframework
- spring-webflux
- true
-
-
-
- io.projectreactor.netty
- reactor-netty-http
- true
-
-
-
- io.projectreactor
- reactor-test
- test
-
-
-
-
- org.elasticsearch.client
- elasticsearch-rest-high-level-client
- ${elasticsearch-rhlc}
- true
-
-
- commons-logging
- commons-logging
-
-
-
-
-
-
- co.elastic.clients
- elasticsearch-java
- ${elasticsearch-java}
-
-
- commons-logging
- commons-logging
-
-
-
-
- org.elasticsearch.client
- elasticsearch-rest-client
- ${elasticsearch-java}
-
-
- commons-logging
- commons-logging
-
-
-
-
-
-
- com.fasterxml.jackson.core
- jackson-core
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
-
-
-
- javax.interceptor
- javax.interceptor-api
- 1.2.2
- test
-
-
-
- jakarta.enterprise
- jakarta.enterprise.cdi-api
- 3.0.1
- provided
- true
-
-
-
- jakarta.annotation
- jakarta.annotation-api
- ${jakarta-annotation-api}
- test
-
-
-
- org.apache.openwebbeans
- openwebbeans-se
- jakarta
- ${webbeans}
- test
-
-
-
- org.apache.openwebbeans
- openwebbeans-spi
- jakarta
- ${webbeans}
- test
-
-
-
- org.apache.openwebbeans
- openwebbeans-impl
- jakarta
- ${webbeans}
- test
-
-
-
-
- org.springframework
- spring-test
- test
-
-
- ch.qos.logback
- logback-classic
-
-
-
-
-
- org.slf4j
- log4j-over-slf4j
- ${slf4j}
- test
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j}
- test
-
-
- org.apache.logging.log4j
- log4j-to-slf4j
- ${log4j}
- test
-
-
-
- io.projectreactor.tools
- blockhound-junit-platform
- ${blockhound-junit}
- test
-
-
-
- org.skyscreamer
- jsonassert
- ${jsonassert}
- test
-
-
-
- com.github.tomakehurst
- wiremock-jre8
- ${wiremock}
- test
-
-
-
- commons-logging
- commons-logging
-
-
- org.ow2.asm
- asm
-
-
-
-
-
- io.specto
- hoverfly-java-junit5
- ${hoverfly}
- test
-
-
-
-
- org.apache.xbean
- xbean-asm5-shaded
- 4.5
- test
-
-
-
- javax.servlet
- javax.servlet-api
- 3.1.0
- test
-
-
-
- org.mockito
- mockito-junit-jupiter
- ${mockito}
- test
-
-
-
- org.testcontainers
- elasticsearch
- ${testcontainers}
- test
-
-
+
+ io.netty
+ netty-bom
+ ${netty}
+ pom
+ import
+
-
-
-
-
- src/main/resources
- true
-
- **/versions.properties
-
-
-
- src/main/resources
- false
-
- **/versions.properties
-
-
-
-
+
+
+
+
+
+
+ org.springframework
+ spring-context
+
+
+
+ org.springframework
+ spring-tx
+
+
+
+
+ org.springframework.data
+ spring-data-commons
+ ${springdata.commons}
+
+
+
+
+ org.springframework
+ spring-webflux
+ true
+
+
+
+ io.projectreactor.netty
+ reactor-netty-http
+ true
+
+
+
+ io.projectreactor
+ reactor-test
+ test
+
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-high-level-client
+ ${elasticsearch-rhlc}
+ true
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+
+
+ co.elastic.clients
+ elasticsearch-java
+ ${elasticsearch-java}
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ ${elasticsearch-java}
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+
+
+ javax.interceptor
+ javax.interceptor-api
+ 1.2.2
+ test
+
+
+
+ jakarta.enterprise
+ jakarta.enterprise.cdi-api
+ 3.0.1
+ provided
+ true
+
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ ${jakarta-annotation-api}
+ test
+
+
+
+ org.apache.openwebbeans
+ openwebbeans-se
+ jakarta
+ ${webbeans}
+ test
+
+
+
+ org.apache.openwebbeans
+ openwebbeans-spi
+ jakarta
+ ${webbeans}
+ test
+
+
+
+ org.apache.openwebbeans
+ openwebbeans-impl
+ jakarta
+ ${webbeans}
+ test
+
+
+
+
+ org.springframework
+ spring-test
+ test
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
+
+
+ org.slf4j
+ log4j-over-slf4j
+ ${slf4j}
+ test
+
+
+ org.apache.logging.log4j
+ log4j-core
+ ${log4j}
+ test
+
+
+ org.apache.logging.log4j
+ log4j-to-slf4j
+ ${log4j}
+ test
+
+
+
+ io.projectreactor.tools
+ blockhound-junit-platform
+ ${blockhound-junit}
+ test
+
+
+
+ org.skyscreamer
+ jsonassert
+ ${jsonassert}
+ test
+
+
+
+ com.github.tomakehurst
+ wiremock-jre8
+ ${wiremock}
+ test
+
+
+
+ commons-logging
+ commons-logging
+
+
+ org.ow2.asm
+ asm
+
+
+
+
+
+ io.specto
+ hoverfly-java-junit5
+ ${hoverfly}
+ test
+
+
+
+
+ org.apache.xbean
+ xbean-asm5-shaded
+ 4.5
+ test
+
+
+
+ javax.servlet
+ javax.servlet-api
+ 3.1.0
+ test
+
+
+
+ org.mockito
+ mockito-junit-jupiter
+ ${mockito}
+ test
+
+
+
+ org.testcontainers
+ elasticsearch
+ ${testcontainers}
+ test
+
+
+
+
+
+
+
+ src/main/resources
+ true
+
+ **/versions.properties
+
+
+
+ src/main/resources
+ false
+
+ **/versions.properties
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ true
+ false
+
+ **/*Tests.java
+ **/*Test.java
+
+
+ false
+
+
+
+
+
+ default-test
+ ${mvn.unit-test.goal}
+
+ test
+
+
+ integration-test
+
+
+
+
+ integration-test-elasticsearch
+ ${mvn.integration-test-elasticsearch.goal}
+
+ test
+
+
+ integration-test
+
+ elasticsearch
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ org.asciidoctor
+ asciidoctor-maven-plugin
+
+
+
+
+
+
+ ci
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+
+
+
+
+
+
+
+
+
+
+ **/*
+
+ .git/**/*,target/**/*,**/target/**/*,.idea/**/*,**/spring.schemas,**/*.svg,mvnw,mvnw.cmd,**/*.policy
+
+ ./
+
+
+
+
+
+
+
+ jdk13+
+
+
+ [13,)
+
+
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- true
- false
-
- **/*Tests.java
- **/*Test.java
-
-
- false
-
-
-
-
-
- default-test
- ${mvn.unit-test.goal}
-
- test
-
-
- integration-test
-
-
-
-
- integration-test-elasticsearch
- ${mvn.integration-test-elasticsearch.goal}
-
- test
-
-
- integration-test
-
- elasticsearch
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
-
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ -XX:+AllowRedefinitionToAddDeleteMethods
+
+
-
-
-
-
- ci
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
-
-
-
-
-
- **/*
-
- .git/**/*,target/**/*,**/target/**/*,.idea/**/*,**/spring.schemas,**/*.svg,mvnw,mvnw.cmd,**/*.policy
-
- ./
-
-
-
-
-
-
-
- jdk13+
-
-
- [13,)
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- -XX:+AllowRedefinitionToAddDeleteMethods
-
-
-
-
-
-
-
-
-
- spring-libs-release
- https://repo.spring.io/libs-release
-
-
-
- local-maven-repo
- file:///${project.basedir}/src/test/resources/local-maven-repo
-
-
-
-
-
-
- spring-plugins-release
- https://repo.spring.io/plugins-release
-
-
+
+
+
+
+
+
+ spring-snapshot
+ https://repo.spring.io/snapshot
+
+ true
+
+
+ false
+
+
+
+ spring-milestone
+ https://repo.spring.io/milestone
+
+
diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc
index 129ad0cadf..a4d241dc84 100644
--- a/src/main/asciidoc/index.adoc
+++ b/src/main/asciidoc/index.adoc
@@ -5,7 +5,7 @@ BioMed Central Development Team; Oliver Drotbohm; Greg Turnquist; Christoph Stro
ifdef::backend-epub3[:front-cover-image: image:epub-cover.png[Front Cover,1050,1600]]
:spring-data-commons-docs: ../../../../spring-data-commons/src/main/asciidoc
-(C) 2013-2022 The original author(s).
+(C) 2013-2024 The original author(s).
NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
diff --git a/src/main/asciidoc/preface.adoc b/src/main/asciidoc/preface.adoc
index d48b391f5c..8732e4f134 100644
--- a/src/main/asciidoc/preface.adoc
+++ b/src/main/asciidoc/preface.adoc
@@ -17,9 +17,9 @@ include::reference/elasticsearch-new.adoc[leveloffset=+1]
* Version Control - https://github.com/spring-projects/spring-data-elasticsearch
* API Documentation - https://docs.spring.io/spring-data/elasticsearch/docs/current/api/
* Bugtracker - https://github.com/spring-projects/spring-data-elasticsearch/issues
-* Release repository - https://repo.spring.io/libs-release
-* Milestone repository - https://repo.spring.io/libs-milestone
-* Snapshot repository - https://repo.spring.io/libs-snapshot
+* Release repository - https://repo1.maven.org/maven2/
+* Milestone repository - https://repo.spring.io/milestone/
+* Snapshot repository - https://repo.spring.io/snapshot/
[[preface.requirements]]
== Requirements
@@ -37,7 +37,7 @@ built and tested.
[cols="^,^,^,^,^",options="header"]
|===
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework | Spring Boot
-| 2023.0 (Ullmann) | 5.1.x | 8.7.0 | 6.0.x | 3.1.x
+| 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x | 3.1.x
| 2022.0 (Turing) | 5.0.x | 8.5.3 | 6.0.x | 3.0.x
| 2021.2 (Raj) | 4.4.xfootnote:oom[Out of maintenance] | 7.17.3 | 5.3.x | 2.7.x
| 2021.1 (Q) | 4.3.xfootnote:oom[] | 7.15.2 | 5.3.x | 2.6.x
diff --git a/src/main/asciidoc/reference/migration-guides.adoc b/src/main/asciidoc/reference/migration-guides.adoc
index 5ef75a1306..cdd23ed121 100644
--- a/src/main/asciidoc/reference/migration-guides.adoc
+++ b/src/main/asciidoc/reference/migration-guides.adoc
@@ -15,4 +15,6 @@ include::elasticsearch-migration-guide-4.3-4.4.adoc[]
include::elasticsearch-migration-guide-4.4-5.0.adoc[]
+include::elasticsearch-migration-guide-5.0-5.1.adoc[]
+
:leveloffset: -1
diff --git a/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java b/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java
index d0b7c48d16..ac1879ba7c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java
index 38f52df0c8..130f218f8f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java
+++ b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java b/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java
index b7a1bbd6e0..a431801aa4 100644
--- a/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java b/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java
index 0b9c0bf3a5..8dac09e1dc 100644
--- a/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java b/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java
index 03170a0708..5ba76a6b29 100644
--- a/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java b/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java
index 8849e21d83..b743cc794f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java b/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java
index c86be98f0a..c04de263ee 100644
--- a/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java
index 4fd6faa383..3d93be01ec 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java
index 95e5060f93..04401340d8 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java
index 463452ca1d..0a0e80752b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java b/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java
index c34adc9caa..92adc763e2 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014-2023 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java
index 0d7855c017..0eeda64db5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java
index fae31617a9..23a82f384b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java
index 0459857d31..dd299a4930 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java
index 316929e4ab..cbb8cd6090 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java
index e17b85ff01..7feda38237 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java
index 865bf694da..0a3be4d2d6 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017-2023 the original author or authors.
+ * Copyright 2017-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java
index 0c59f2d149..3b93f232d6 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java
index 4dbf7e92ba..73063b3451 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java
index 55cb5ab579..dca0e3fe0a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java
index b396786abb..89637309a9 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java
index 9d8333b0f8..76a481f735 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java
index 1a15f506c9..fd8cc8146a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 the original author or authors.
+ * Copyright 2023-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java
index 3d1bd46e62..ceb6054119 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014-2023 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java
index f814588112..4e544bd4c4 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java
index 6127b94849..fb1be2b68c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java
index 2cdaa29efd..125f1a7672 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014-2023 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java
index 1469a714d6..0901be082d 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014-2023 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java
index d3df4bdd94..8707def774 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java
index 0d97af4e6f..f5746a3551 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java
index db4288565d..51f31b3b25 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2014-2023 the original author or authors.
+ * Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java
index dd1ce02a68..143996ea54 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java b/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java
index 2b488205d2..73f434999a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java b/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java
index e37a0133ff..377ed9063a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java
index 2f8485d848..5e07262799 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java
index cfc36f4561..12ca0e1d22 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java
index 23fbcfd036..d62a704b7c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java
+++ b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java b/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java
index 4d301a5838..e751a40237 100644
--- a/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java
+++ b/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 the original author or authors.
+ * Copyright 2023-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchRuntimeHints.java
index 049901421d..99b1e93529 100644
--- a/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchRuntimeHints.java
+++ b/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchRuntimeHints.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 the original author or authors.
+ * Copyright 2023-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java
index ff802c3aba..f6b098f0dc 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java
index beb3097bd6..0b7b0a6600 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java
index cf314d04f2..3a86776a67 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java
index 599af28e30..d33f3f1be5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java b/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java
index a6406dfad2..f422ecded2 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java b/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java
index a8dc5e13f8..e5d9cd1f2d 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java b/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java
index 4a28d664d0..2487768785 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java
index 252f5524ec..1268ff3262 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java
index bd5a539c51..112a03c783 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java
index 7e66d9c05c..ab46cad895 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java
index d559d4f7c7..d6489ba19c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java
index d5c1bcf4c1..633c858d46 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java
index 0454b4a452..44f3f7a51b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java
index 9b52c375e0..e349db8c7b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java
index cdb4e98e4c..2d43553d55 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java
index 5e01e2f81a..2e8dcb6659 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java
index 69e69e61c8..80dfad50a7 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -138,7 +138,7 @@ public static SearchDocument from(Hit> hit, JsonpMapper jsonpMapper) {
document.setPrimaryTerm(hit.primaryTerm() != null && hit.primaryTerm() > 0 ? hit.primaryTerm() : 0);
float score = hit.score() != null ? hit.score().floatValue() : Float.NaN;
- return new SearchDocumentAdapter(document, score, hit.sort().stream().map(TypeUtils::toString).toArray(),
+ return new SearchDocumentAdapter(document, score, hit.sort().stream().map(TypeUtils::toObject).toArray(),
documentFields, highlightFields, innerHits, nestedMetaData, explanation, matchedQueries, hit.routing());
}
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java
index e98f790467..4a4b442b11 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java
index a21d04b1c3..10633a0ece 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java
index b60b9605ca..9bde4ada1a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java
index 65868e5360..d7e2aa10dc 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java
index 2549d7a17e..1ca8d87886 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,9 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.http.*;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.entity.ByteArrayEntity;
@@ -269,7 +272,14 @@ private static ElasticsearchTransport getElasticsearchTransport(RestClient restC
TransportOptions transportOptionsWithHeader = transportOptionsBuilder
.addHeader(X_SPRING_DATA_ELASTICSEARCH_CLIENT, clientType).build();
- return new RestClientTransport(restClient, new JacksonJsonpMapper(), transportOptionsWithHeader);
+ // we need to create our own objectMapper that keeps null values in order to provide the storeNullValue
+ // functionality. The one Elasticsearch would provide removes the nulls. We remove unwanted nulls before they get
+ // into this mapper, so we can safely keep them here.
+ var objectMapper = (new ObjectMapper())
+ .configure(SerializationFeature.INDENT_OUTPUT, false)
+ .setSerializationInclusion(JsonInclude.Include.ALWAYS);
+
+ return new RestClientTransport(restClient, new JacksonJsonpMapper(objectMapper), transportOptionsWithHeader);
}
private static List formattedHosts(List hosts, boolean useSsl) {
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java
index 2f06eb2a61..965b676469 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java
index 3cdf391762..bda6ad6bc0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java
index b6b57f96a5..79ad9dec31 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java
index c0b53585cf..b014f89ec3 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java
index fa7ccc9ec0..b26b016bbf 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java
index 208422adef..fe4a55b49c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java
index 5c9781b5f5..64697766e7 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java
index 93d3e2f442..880cb7ae08 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java
index 3a831e4bd4..e2eeb49fa4 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java
index c7ea1e3728..a0062bb9df 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/QueryBuilders.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/QueryBuilders.java
index 27c83c4923..66e58c6c40 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/QueryBuilders.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/QueryBuilders.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java
index 3f25f7e19b..60e02c1ba7 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java
index 697aa09099..b3b0acda05 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java
index 39131d78dc..7095eb06c9 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java
index 0e5f4b7d25..bbe1177a9f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java
index d1feed24b9..235362e81c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java
index c5b106a119..f274f7c66b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java
index 1fdb0b1166..7421ff2dae 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -642,7 +642,7 @@ public Query idsQuery(List ids) {
*
* @param
*/
- interface ClientCallback> {
+ public interface ClientCallback> {
T doWithClient(ReactiveElasticsearchClient client);
}
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java
index d857945b9b..82f21f1072 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java
index 4778bd5949..b1d7a8fbf3 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,18 +16,24 @@
package org.springframework.data.elasticsearch.client.elc;
import static org.springframework.data.elasticsearch.client.elc.TypeUtils.*;
-import static org.springframework.util.CollectionUtils.isEmpty;
-
-import co.elastic.clients.elasticsearch._types.*;
+import static org.springframework.util.CollectionUtils.*;
+
+import co.elastic.clients.elasticsearch._types.Conflicts;
+import co.elastic.clients.elasticsearch._types.InlineScript;
+import co.elastic.clients.elasticsearch._types.OpType;
+import co.elastic.clients.elasticsearch._types.SortOptions;
+import co.elastic.clients.elasticsearch._types.SortOrder;
+import co.elastic.clients.elasticsearch._types.VersionType;
+import co.elastic.clients.elasticsearch._types.WaitForActiveShardOptions;
import co.elastic.clients.elasticsearch._types.mapping.FieldType;
import co.elastic.clients.elasticsearch._types.mapping.RuntimeField;
import co.elastic.clients.elasticsearch._types.mapping.RuntimeFieldType;
import co.elastic.clients.elasticsearch._types.query_dsl.FieldAndFormat;
import co.elastic.clients.elasticsearch._types.query_dsl.Like;
-import co.elastic.clients.elasticsearch.cluster.*;
import co.elastic.clients.elasticsearch.cluster.DeleteComponentTemplateRequest;
import co.elastic.clients.elasticsearch.cluster.ExistsComponentTemplateRequest;
import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateRequest;
+import co.elastic.clients.elasticsearch.cluster.HealthRequest;
import co.elastic.clients.elasticsearch.cluster.PutComponentTemplateRequest;
import co.elastic.clients.elasticsearch.core.*;
import co.elastic.clients.elasticsearch.core.bulk.BulkOperation;
@@ -52,7 +58,12 @@
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -528,13 +539,12 @@ public IndexRequest> documentIndexRequest(IndexQuery query, IndexCoordinates i
Object queryObject = query.getObject();
if (queryObject != null) {
- String id = StringUtils.hasText(query.getId()) ? query.getId() : getPersistentEntityId(queryObject);
- builder //
- .id(id) //
+ builder
+ .id(StringUtils.hasText(query.getId()) ? query.getId() : getPersistentEntityId(queryObject))
.document(elasticsearchConverter.mapObject(queryObject));
} else if (query.getSource() != null) {
- builder //
- .id(query.getId()) //
+ builder
+ .id(query.getId())
.document(new DefaultStringObjectMap<>().fromJson(query.getSource()));
} else {
throw new InvalidDataAccessApiUsageException(
@@ -580,12 +590,13 @@ private IndexOperation> bulkIndexOperation(IndexQuery query, IndexCoordinates
Object queryObject = query.getObject();
if (queryObject != null) {
- String id = StringUtils.hasText(query.getId()) ? query.getId() : getPersistentEntityId(queryObject);
- builder //
- .id(id) //
+ builder
+ .id(StringUtils.hasText(query.getId()) ? query.getId() : getPersistentEntityId(queryObject))
.document(elasticsearchConverter.mapObject(queryObject));
} else if (query.getSource() != null) {
- builder.document(new DefaultStringObjectMap<>().fromJson(query.getSource()));
+ builder
+ .id(query.getId())
+ .document(new DefaultStringObjectMap<>().fromJson(query.getSource()));
} else {
throw new InvalidDataAccessApiUsageException(
"object or source is null, failed to index the document [id: " + query.getId() + ']');
@@ -621,12 +632,13 @@ private CreateOperation> bulkCreateOperation(IndexQuery query, IndexCoordinate
Object queryObject = query.getObject();
if (queryObject != null) {
- String id = StringUtils.hasText(query.getId()) ? query.getId() : getPersistentEntityId(queryObject);
- builder //
- .id(id) //
+ builder
+ .id(StringUtils.hasText(query.getId()) ? query.getId() : getPersistentEntityId(queryObject))
.document(elasticsearchConverter.mapObject(queryObject));
} else if (query.getSource() != null) {
- builder.document(new DefaultStringObjectMap<>().fromJson(query.getSource()));
+ builder
+ .id(query.getId())
+ .document(new DefaultStringObjectMap<>().fromJson(query.getSource()));
} else {
throw new InvalidDataAccessApiUsageException(
"object or source is null, failed to index the document [id: " + query.getId() + ']');
@@ -988,7 +1000,7 @@ public DeleteByQueryRequest documentDeleteByQueryRequest(Query query, @Nullable
.docAsUpsert(query.getDocAsUpsert()) //
.ifSeqNo(query.getIfSeqNo() != null ? Long.valueOf(query.getIfSeqNo()) : null) //
.ifPrimaryTerm(query.getIfPrimaryTerm() != null ? Long.valueOf(query.getIfPrimaryTerm()) : null) //
- .refresh(refresh(refreshPolicy)) //
+ .refresh(query.getRefreshPolicy() != null ? refresh(query.getRefreshPolicy()) : refresh(refreshPolicy)) //
.retryOnConflict(query.getRetryOnConflict()) //
;
@@ -1175,10 +1187,9 @@ public MsearchRequest searchMsearchRequest(
}
if (!isEmpty(query.getFields())) {
- bb.fields(fb -> {
- query.getFields().forEach(fb::field);
- return fb;
- });
+ var fieldAndFormats = query.getFields().stream()
+ .map(field -> FieldAndFormat.of(b -> b.field(field))).toList();
+ bb.fields(fieldAndFormats);
}
if (!isEmpty(query.getStoredFields())) {
@@ -1208,8 +1219,7 @@ public MsearchRequest searchMsearchRequest(
}
if (!isEmpty(query.getSearchAfter())) {
- bb.searchAfter(query.getSearchAfter().stream().map(it -> FieldValue.of(it.toString()))
- .collect(Collectors.toList()));
+ bb.searchAfter(query.getSearchAfter().stream().map(TypeUtils::toFieldValue).toList());
}
query.getRescorerQueries().forEach(rescorerQuery -> bb.rescore(getRescore(rescorerQuery)));
@@ -1233,11 +1243,9 @@ public MsearchRequest searchMsearchRequest(
}
if (!isEmpty(query.getIndicesBoost())) {
- Map boosts = new LinkedHashMap<>();
- query.getIndicesBoost()
- .forEach(indexBoost -> boosts.put(indexBoost.getIndexName(), (double) indexBoost.getBoost()));
- // noinspection unchecked
- bb.indicesBoost(boosts);
+ bb.indicesBoost(query.getIndicesBoost().stream()
+ .map(indexBoost -> Map.of(indexBoost.getIndexName(), Double.valueOf(indexBoost.getBoost())))
+ .collect(Collectors.toList()));
}
query.getScriptedFields().forEach(scriptedField -> bb.scriptFields(scriptedField.getFieldName(),
@@ -1313,10 +1321,9 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu
}
if (!isEmpty(query.getFields())) {
- builder.fields(fb -> {
- query.getFields().forEach(fb::field);
- return fb;
- });
+ var fieldAndFormats = query.getFields().stream()
+ .map(field -> FieldAndFormat.of(b -> b.field(field))).toList();
+ builder.fields(fieldAndFormats);
}
if (!isEmpty(query.getStoredFields())) {
@@ -1335,14 +1342,6 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu
builder.minScore((double) query.getMinScore());
}
- if (query.getSort() != null) {
- List sortOptions = getSortOptions(query.getSort(), persistentEntity);
-
- if (!sortOptions.isEmpty()) {
- builder.sort(sortOptions);
- }
- }
-
addHighlight(query, builder);
query.getScriptedFields().forEach(scriptedField -> builder.scriptFields(scriptedField.getFieldName(),
@@ -1351,6 +1350,15 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu
if (query instanceof NativeQuery) {
prepareNativeSearch((NativeQuery) query, builder);
}
+ // query.getSort() must be checked after prepareNativeSearch as this already might hav a sort set that must have
+ // higher priority
+ if (query.getSort() != null) {
+ List sortOptions = getSortOptions(query.getSort(), persistentEntity);
+
+ if (!sortOptions.isEmpty()) {
+ builder.sort(sortOptions);
+ }
+ }
if (query.getTrackTotalHits() != null) {
// logic from the RHLC, choose between -1 and Integer.MAX_VALUE
@@ -1365,8 +1373,7 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu
}
if (!isEmpty(query.getSearchAfter())) {
- builder.searchAfter(
- query.getSearchAfter().stream().map(it -> FieldValue.of(it.toString())).collect(Collectors.toList()));
+ builder.searchAfter(query.getSearchAfter().stream().map(TypeUtils::toFieldValue).toList());
}
query.getRescorerQueries().forEach(rescorerQuery -> builder.rescore(getRescore(rescorerQuery)));
@@ -1399,11 +1406,9 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu
}
if (!isEmpty(query.getIndicesBoost())) {
- Map boosts = new LinkedHashMap<>();
- query.getIndicesBoost()
- .forEach(indexBoost -> boosts.put(indexBoost.getIndexName(), (double) indexBoost.getBoost()));
- // noinspection unchecked
- builder.indicesBoost(boosts);
+ builder.indicesBoost(query.getIndicesBoost().stream()
+ .map(indexBoost -> Map.of(indexBoost.getIndexName(), Double.valueOf(indexBoost.getBoost())))
+ .collect(Collectors.toList()));
}
if (!isEmpty(query.getDocValueFields())) {
@@ -1477,8 +1482,9 @@ private SortOptions getSortOptions(Sort.Order order, @Nullable ElasticsearchPers
return SortOptions.of(so -> so //
.geoDistance(gd -> gd //
.field(fieldName) //
- .location(loc -> loc.latlon(Queries.latLon(geoDistanceOrder.getGeoPoint())))//
+ .location(loc -> loc.latlon(Queries.latLon(geoDistanceOrder.getGeoPoint()))) //
.distanceType(geoDistanceType(geoDistanceOrder.getDistanceType())).mode(sortMode(finalMode)) //
+ .order(sortOrder(geoDistanceOrder.getDirection())) //
.unit(distanceUnit(geoDistanceOrder.getUnit())) //
.ignoreUnmapped(geoDistanceOrder.getIgnoreUnmapped())));
} else {
@@ -1537,8 +1543,11 @@ private void prepareNativeSearch(NativeQuery query, MultisearchBody.Builder buil
builder //
.suggest(query.getSuggester()) //
.collapse(query.getFieldCollapse()) //
- .sort(query.getSortOptions()) //
- .knn(query.getKnnQuery());
+ .sort(query.getSortOptions());
+
+ if (query.getKnnQuery() != null) {
+ builder.knn(query.getKnnQuery());
+ }
if (!isEmpty(query.getAggregations())) {
builder.aggregations(query.getAggregations());
@@ -1585,8 +1594,13 @@ private void addFilter(Query query, SearchRequest.Builder builder) {
CriteriaFilterProcessor.createQuery(((CriteriaQuery) query).getCriteria()).ifPresent(builder::postFilter);
} else if (query instanceof StringQuery) {
// no filter for StringQuery
- } else if (query instanceof NativeQuery) {
- builder.postFilter(((NativeQuery) query).getFilter());
+ } else if (query instanceof NativeQuery nativeQuery) {
+
+ if (nativeQuery.getFilter() != null) {
+ builder.postFilter(nativeQuery.getFilter());
+ } else if (nativeQuery.getSpringDataQuery() != null) {
+ addFilter(nativeQuery.getSpringDataQuery(), builder);
+ }
} else {
throw new IllegalArgumentException("unhandled Query implementation " + query.getClass().getName());
}
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java
index 11bd0fefa6..bb91ab2f8a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java
index 18f7b7907e..ad84054bac 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -219,7 +219,8 @@ private static PhraseSuggestion getPhraseSuggestion(String name, List options = new ArrayList<>();
phraseSuggestOptions.forEach(optionES -> options
- .add(new PhraseSuggestion.Entry.Option(optionES.text(), optionES.highlighted(), null, null)));
+ .add(new PhraseSuggestion.Entry.Option(optionES.text(), optionES.highlighted(), optionES.score(),
+ optionES.collateMatch())));
entries.add(new PhraseSuggestion.Entry(phraseSuggest.text(), phraseSuggest.offset(), phraseSuggest.length(),
options, null));
});
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java
index ba2ae1c5dc..c4727e2306 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,15 @@
import co.elastic.clients.elasticsearch._types.*;
import co.elastic.clients.elasticsearch._types.mapping.FieldType;
import co.elastic.clients.elasticsearch._types.mapping.TypeMapping;
-import co.elastic.clients.elasticsearch.core.search.*;
+import co.elastic.clients.elasticsearch.core.search.BoundaryScanner;
+import co.elastic.clients.elasticsearch.core.search.HighlighterEncoder;
+import co.elastic.clients.elasticsearch.core.search.HighlighterFragmenter;
+import co.elastic.clients.elasticsearch.core.search.HighlighterOrder;
+import co.elastic.clients.elasticsearch.core.search.HighlighterTagsSchema;
+import co.elastic.clients.elasticsearch.core.search.HighlighterType;
+import co.elastic.clients.elasticsearch.core.search.ScoreMode;
import co.elastic.clients.elasticsearch.indices.IndexSettings;
+import co.elastic.clients.json.JsonData;
import java.io.StringReader;
import java.time.Duration;
@@ -28,10 +35,16 @@
import java.util.Map;
import java.util.stream.Collectors;
+import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.core.RefreshPolicy;
import org.springframework.data.elasticsearch.core.document.Document;
-import org.springframework.data.elasticsearch.core.query.*;
+import org.springframework.data.elasticsearch.core.query.GeoDistanceOrder;
+import org.springframework.data.elasticsearch.core.query.IndexQuery;
import org.springframework.data.elasticsearch.core.query.IndicesOptions;
+import org.springframework.data.elasticsearch.core.query.Order;
+import org.springframework.data.elasticsearch.core.query.Query;
+import org.springframework.data.elasticsearch.core.query.RescorerQuery;
+import org.springframework.data.elasticsearch.core.query.UpdateResponse;
import org.springframework.data.elasticsearch.core.reindex.ReindexRequest;
import org.springframework.lang.Nullable;
@@ -155,6 +168,40 @@ static Object toObject(@Nullable FieldValue fieldValue) {
}
}
+ @Nullable
+ static FieldValue toFieldValue(@Nullable Object fieldValue) {
+
+ if (fieldValue == null) {
+ return FieldValue.NULL;
+ }
+
+ if (fieldValue instanceof Boolean b) {
+ return b ? FieldValue.TRUE : FieldValue.FALSE;
+ }
+
+ if (fieldValue instanceof String s) {
+ return FieldValue.of(s);
+ }
+
+ if (fieldValue instanceof Long l) {
+ return FieldValue.of(l);
+ }
+
+ if (fieldValue instanceof Integer i) {
+ return FieldValue.of((long) i);
+ }
+
+ if (fieldValue instanceof Double d) {
+ return FieldValue.of(d);
+ }
+
+ if (fieldValue instanceof Float f) {
+ return FieldValue.of((double) f);
+ }
+
+ return FieldValue.of(JsonData.of(fieldValue));
+ }
+
@Nullable
static GeoDistanceType geoDistanceType(GeoDistanceOrder.DistanceType distanceType) {
@@ -165,6 +212,20 @@ static GeoDistanceType geoDistanceType(GeoDistanceOrder.DistanceType distanceTyp
}
+ @Nullable
+ static SortOrder sortOrder(@Nullable Sort.Direction direction) {
+
+ if (direction == null) {
+ return null;
+ }
+
+ return switch (direction) {
+ case ASC -> SortOrder.Asc;
+ case DESC -> SortOrder.Desc;
+ };
+
+ }
+
@Nullable
static HighlighterFragmenter highlighterFragmenter(@Nullable String value) {
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java
index 48a5be5aa2..bbaf17c924 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 the original author or authors.
+ * Copyright 2023-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java
index ab8646f0a9..2b9dc4c08a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractElasticsearchConfiguration.java
index 2a32f48fd0..25a2d3cdc2 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractElasticsearchConfiguration.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractElasticsearchConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractReactiveElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractReactiveElasticsearchConfiguration.java
index 053f8815b6..1ff466838f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractReactiveElasticsearchConfiguration.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/AbstractReactiveElasticsearchConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaFilterProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaFilterProcessor.java
index b867a287d4..e445b21dbd 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaFilterProcessor.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaFilterProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaQueryProcessor.java
index bd001c2677..2a2d89eb0a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaQueryProcessor.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/CriteriaQueryProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultClusterOperations.java
index dfe2fc2146..20fbc65c83 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultClusterOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultClusterOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveClusterOperations.java
index 8852719ad6..78f8738957 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveClusterOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveClusterOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveElasticsearchClient.java
index fab8252ebf..13dc1996c9 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveElasticsearchClient.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultReactiveElasticsearchClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultRequestCreator.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultRequestCreator.java
index f7e151bce6..a202441e5c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultRequestCreator.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultRequestCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultWebClientProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultWebClientProvider.java
index 0a7518a057..50e4fb3c62 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultWebClientProvider.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DefaultWebClientProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DocumentAdapters.java
index 443a0ce3ca..69f392ec72 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DocumentAdapters.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/DocumentAdapters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregation.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregation.java
index e86d6204c6..10ba6bc2e4 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregations.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregations.java
index da4c4f0481..10dc41bc42 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchAggregations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchClusterOperations.java
index 229df5f604..e9b69a1bd4 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchClusterOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchClusterOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchExceptionTranslator.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchExceptionTranslator.java
index 1940d0aade..2911e967b6 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchExceptionTranslator.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchExceptionTranslator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchRestTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchRestTemplate.java
index 327d69f988..f21abb7158 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchRestTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ElasticsearchRestTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HighlightQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HighlightQueryBuilder.java
index b7b73c4e05..8bf9734b6c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HighlightQueryBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HighlightQueryBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HostProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HostProvider.java
index b936b28f34..4a0d7b6a71 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HostProvider.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/HostProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/MultiNodeHostProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/MultiNodeHostProvider.java
index 43b5535388..94c25b9a2a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/MultiNodeHostProvider.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/MultiNodeHostProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NamedXContents.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NamedXContents.java
index dd6ca7ed04..8a7e1c788c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NamedXContents.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NamedXContents.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQuery.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQuery.java
index 9fedd80cf9..844a5f92e6 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQuery.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQuery.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQueryBuilder.java
index 3bbe3447cf..5929cd2bd8 100755
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQueryBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/NativeSearchQueryBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RawActionResponse.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RawActionResponse.java
index 57ece9e92b..7d044b254c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RawActionResponse.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RawActionResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchClient.java
index 3cee16c2f6..36c10cf998 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchClient.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchTemplate.java
index d297379934..6bf0a7c779 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveElasticsearchTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveIndexTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveIndexTemplate.java
index c44bfffdac..889d9514a7 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveIndexTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveIndexTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveRestClients.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveRestClients.java
index e7752ed18d..d7c848c61d 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveRestClients.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ReactiveRestClients.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestBodyEncodingException.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestBodyEncodingException.java
index 48f9d12a5b..c1578c0b80 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestBodyEncodingException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestBodyEncodingException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestConverters.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestConverters.java
index 6f7d6eabe4..e8542a40ad 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestConverters.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestConverters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestCreator.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestCreator.java
index 5a3837661d..9312e607a9 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestCreator.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestFactory.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestFactory.java
index 1e29f0b6c8..9ba62f280c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestFactory.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RequestFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -348,8 +348,8 @@ public PutIndexTemplateRequest putIndexTemplateRequest(PutTemplateRequest putTem
for (String aliasName : parametersAliases) {
Alias alias = new Alias(aliasName);
- //noinspection DuplicatedCode
- if (parameters.getRouting() != null) {
+ // noinspection DuplicatedCode
+ if (parameters.getRouting() != null) {
alias.routing(parameters.getRouting());
}
@@ -526,7 +526,8 @@ public org.elasticsearch.index.reindex.ReindexRequest reindexRequest(ReindexRequ
// endregion
// region delete
- public DeleteByQueryRequest deleteByQueryRequest(Query query, @Nullable String routing, Class> clazz, IndexCoordinates index) {
+ public DeleteByQueryRequest deleteByQueryRequest(Query query, @Nullable String routing, Class> clazz,
+ IndexCoordinates index) {
SearchRequest searchRequest = searchRequest(query, routing, clazz, index);
DeleteByQueryRequest deleteByQueryRequest = new DeleteByQueryRequest(index.getIndexNames()) //
.setQuery(searchRequest.source().query()) //
@@ -754,10 +755,11 @@ public SearchRequest searchRequest(SuggestBuilder suggestion, IndexCoordinates i
return searchRequest;
}
- public SearchRequest searchRequest(Query query, @Nullable String routing, @Nullable Class> clazz, IndexCoordinates index) {
+ public SearchRequest searchRequest(Query query, @Nullable String routing, @Nullable Class> clazz,
+ IndexCoordinates index) {
elasticsearchConverter.updateQuery(query, clazz);
- SearchRequest searchRequest = prepareSearchRequest(query, routing,clazz, index);
+ SearchRequest searchRequest = prepareSearchRequest(query, routing, clazz, index);
QueryBuilder elasticsearchQuery = getQuery(query);
QueryBuilder elasticsearchFilter = getFilter(query);
@@ -771,7 +773,8 @@ public SearchRequest searchRequest(Query query, @Nullable String routing, @Nulla
}
- private SearchRequest prepareSearchRequest(Query query, @Nullable String routing, @Nullable Class> clazz, IndexCoordinates indexCoordinates) {
+ private SearchRequest prepareSearchRequest(Query query, @Nullable String routing, @Nullable Class> clazz,
+ IndexCoordinates indexCoordinates) {
String[] indexNames = indexCoordinates.getIndexNames();
Assert.notNull(indexNames, "No index defined for Query");
@@ -968,6 +971,8 @@ private SortBuilder> getSortBuilder(Sort.Order order, @Nullable ElasticsearchP
sort.ignoreUnmapped(geoDistanceOrder.getIgnoreUnmapped());
}
+ sort.order(order.isAscending() ? SortOrder.ASC : SortOrder.DESC);
+
return sort;
} else {
FieldSortBuilder sort = SortBuilders //
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ResponseConverter.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ResponseConverter.java
index 81a514a155..a7f04efbff 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ResponseConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ResponseConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestClients.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestClients.java
index 61bd3f4a3c..cacadbc16e 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestClients.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestClients.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientBeanDefinitionParser.java
index f50993bd0d..ad96e87039 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientBeanDefinitionParser.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientFactoryBean.java
index 9b1dfa59ae..79560a7795 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientFactoryBean.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestHighLevelClientFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestIndexTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestIndexTemplate.java
index b9a309003e..7f5a96e61e 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestIndexTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/RestIndexTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ScriptField.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ScriptField.java
index ebb27b04db..384a1c0c91 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ScriptField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/ScriptField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchDocumentResponseBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchDocumentResponseBuilder.java
index 22156ecd4e..788ed4b65c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchDocumentResponseBuilder.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchDocumentResponseBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchHitsUtil.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchHitsUtil.java
index c82479e668..22d649f7e0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchHitsUtil.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SearchHitsUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SingleNodeHostProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SingleNodeHostProvider.java
index 3678057756..e46442428d 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SingleNodeHostProvider.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/SingleNodeHostProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/WebClientProvider.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/WebClientProvider.java
index e8ce2f66a5..3a356059bd 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/WebClientProvider.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/WebClientProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/package-info.java
index 5fa79bdc30..37ed488fc6 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/erhlc/package-info.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/erhlc/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 the original author or authors.
+ * Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java b/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java
index c4ed1f942a..ddb7151ce0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java
index 838f1b7a6d..a730003aef 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java
index dc0ca6d63d..018079155c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java
index 064a9a65af..c210a192f1 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java
index 1dbc8fe87d..9cc4ea4618 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java b/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java
index 7b4825bfb1..0290025aea 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java b/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java
index 0646637c74..e5cbaea27b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java
index 7b24d5b819..5a87309869 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java
index 7abb4d33e4..cecb2fe742 100644
--- a/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java
+++ b/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java
index 7ff8d6f48b..198cce4f7f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractIndexTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractIndexTemplate.java
index ad863e5551..4ad4bda7f9 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractIndexTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractIndexTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java
index 0a77504c83..6a54f0ec15 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -225,42 +225,42 @@ public Flux save(Flux entities, IndexCoordinates index, int bulkSize)
return Flux.defer(() -> {
Sinks.Many sink = Sinks.many().unicast().onBackpressureBuffer();
- entities //
- .bufferTimeout(bulkSize, Duration.ofMillis(200)) //
- .subscribe(new Subscriber>() {
- private Subscription subscription;
- private AtomicBoolean upstreamComplete = new AtomicBoolean(false);
-
- @Override
- public void onSubscribe(Subscription subscription) {
- this.subscription = subscription;
- subscription.request(1);
- }
-
- @Override
- public void onNext(List entityList) {
- saveAll(entityList, index) //
- .map(sink::tryEmitNext) //
- .doOnComplete(() -> {
- if (!upstreamComplete.get()) {
- subscription.request(1);
- } else {
- sink.tryEmitComplete();
- }
- }).subscribe();
- }
-
- @Override
- public void onError(Throwable throwable) {
- subscription.cancel();
- sink.tryEmitError(throwable);
- }
-
- @Override
- public void onComplete() {
- upstreamComplete.set(true);
- }
- });
+ entities.window(bulkSize) //
+ .concatMap(flux -> flux.collectList()) //
+ .subscribe(new Subscriber>() {
+ private Subscription subscription;
+ private AtomicBoolean upstreamComplete = new AtomicBoolean(false);
+
+ @Override
+ public void onSubscribe(Subscription subscription) {
+ this.subscription = subscription;
+ subscription.request(1);
+ }
+
+ @Override
+ public void onNext(List entityList) {
+ saveAll(entityList, index) //
+ .map(sink::tryEmitNext) //
+ .doOnComplete(() -> {
+ if (!upstreamComplete.get()) {
+ subscription.request(1);
+ } else {
+ sink.tryEmitComplete();
+ }
+ }).subscribe();
+ }
+
+ @Override
+ public void onError(Throwable throwable) {
+ subscription.cancel();
+ sink.tryEmitError(throwable);
+ }
+
+ @Override
+ public void onComplete() {
+ upstreamComplete.set(true);
+ }
+ });
return sink.asFlux();
});
@@ -748,6 +748,12 @@ public ElasticsearchPersistentEntity> getPersistentEntityFor(@Nullable Class
public abstract Mono getClusterVersion();
+ @Nullable
+ public String getEntityRouting(Object entity) {
+ return entityOperations.forEntity(entity, converter.getConversionService(), routingResolver)
+ .getRouting();
+ }
+
/**
* Value class to capture client independent information from a response to an index request.
*/
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java b/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java
index 359c69b436..4751c9322d 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java b/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java
index fc33d5e8e4..fa35a78d8b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java b/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java
index 7e2ad40c8b..e6e3d0d731 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java
index a51bc911b4..04e147007b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java
index 1624c66e19..78f6f25881 100755
--- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java
index fdf701c7c0..78b8cb1c09 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java
index d27703f15a..f6ed2269a8 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java
index 4caa3c68bb..d09fb3861f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java
index 1c7d95f4dd..1b4e34ad9e 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java
index b06ace378b..827ea83acf 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/Range.java b/src/main/java/org/springframework/data/elasticsearch/core/Range.java
index bb3959ced0..3b943f9122 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/Range.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/Range.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java
index 65aec898db..5aef1bc2f5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java
index 8cc95a8253..2a7f678271 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -117,6 +117,17 @@ public interface ReactiveElasticsearchOperations
ReactiveClusterOperations cluster();
// region routing
+ /**
+ * gets the routing for an entity.
+ *
+ * @param entity the entity
+ * @return the routing, may be null if not set.
+ * @since 5.2
+ */
+ @Nullable
+ String getEntityRouting(Object entity);
+
+ // region customizations
/**
* Returns a copy of this instance with the same configuration, but that uses a different {@link RoutingResolver} to
* obtain routing information.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java
index ad5d219514..a4cc50c222 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java
index 66cf014f1e..56671cd059 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java
index 60af99c9cf..f8d84b7434 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java
index 94d536296a..d382cc0e77 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java
index c84a83c57c..84c25d776e 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java
index 2b44d2aa15..3a71cdfa50 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java b/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java
index 5d6a059250..5112dd14b5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java b/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java
index dd2c5f4d55..83184645bd 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/RuntimeField.java b/src/main/java/org/springframework/data/elasticsearch/core/RuntimeField.java
index a2302e7c5e..9dd232f1ce 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/RuntimeField.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/RuntimeField.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ScriptType.java b/src/main/java/org/springframework/data/elasticsearch/core/ScriptType.java
index f10f72d5bc..8ec21f980e 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/ScriptType.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/ScriptType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java
index caf4d63b71..a811d6f093 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java
index 8c5d176581..b2ac50cce2 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java
index b6fa455c7f..18a553ce0c 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java
index 9356808798..bb29ab8559 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java
index e80f1e3c76..a63a1a24d5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java
index 3f92a2157e..5246903f4a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java
index 7a9c29a803..606cbd85a5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java
index 76f54ddad4..fd07115aa0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java
index fefdddd4d0..463ddf6b55 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java
index d414099f0f..d1603dc976 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java b/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java
index b3fb9cff20..c82520223b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2023 the original author or authors.
+ * Copyright 2020-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java
index e30e55248e..8d79e1df4b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java
index ff7ba80550..aa535d76ad 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java
index 03108f6297..279a4be763 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java
index 3bc05849d4..08f8b52d8a 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java
index 64660d2ad5..fb05f4cb35 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,9 +32,19 @@ public abstract class AbstractRangePropertyValueConverter extends AbstractPro
protected static final String LTE_FIELD = "lte";
protected static final String GT_FIELD = "gt";
protected static final String GTE_FIELD = "gte";
+ private final Class> genericType;
- public AbstractRangePropertyValueConverter(PersistentProperty> property) {
+ /**
+ * @param property the property this convertrer belongs to
+ * @param genericType the generic type of the Range
+ */
+ public AbstractRangePropertyValueConverter(PersistentProperty> property, Class> genericType) {
super(property);
+ this.genericType = genericType;
+ }
+
+ public Class> getGenericType() {
+ return genericType;
}
@Override
@@ -117,10 +127,6 @@ public Object write(Object value) {
protected abstract String format(T value);
- protected Class> getGenericType() {
- return getProperty().getTypeInformation().getTypeArguments().get(0).getType();
- }
-
protected abstract T parse(String value);
}
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java
index 13f640c402..a626fbbe97 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java
index 7f742e1c3a..c163b31cd0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java
index bc35e8cae7..0af0cfa78f 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java
index 32989a015d..11c84f3ee0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the original author or authors.
+ * Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,9 +33,9 @@ public class DateRangePropertyValueConverter extends AbstractRangePropertyValueC
private final List dateConverters;
public DateRangePropertyValueConverter(PersistentProperty> property,
- List dateConverters) {
+ Class> genericType, List dateConverters) {
- super(property);
+ super(property, genericType);
this.dateConverters = dateConverters;
}
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java
index 35365b8d28..a2ab473c25 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java
index 0fa49f0352..323253a7f5 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java
index dbf197f69f..1e36cbadc0 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-2023 the original author or authors.
+ * Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
index e0d8acf6a3..4545871dc8 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java
index 3de9df6254..331c6ac1c1 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
index 1156de1b1c..33c1059f29 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2023 the original author or authors.
+ * Copyright 2019-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
index 47e55867fa..003fa9fd96 100644
--- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2023 the original author or authors.
+ * Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -919,7 +919,7 @@ private List