Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c34dc53f3 | |||
| 85b6acebb2 | |||
| 00155c2b31 | |||
| d0020be57d | |||
| 20a6140fe9 | |||
| cdb48c8226 | |||
| 493476567a | |||
| a7c148653f | |||
| 3092db9e7d | |||
| d8917f1cb1 | |||
| cc533b25f1 | |||
| c5231d879d | |||
| 950ca0fc2a | |||
| 95a86f558b | |||
| 8117e5a174 | |||
| 3a9a959918 | |||
| a179dd0643 | |||
| 310ea07c6f | |||
| 34a277cd7d | |||
| 878dc029ec |
+2
-2
@@ -1,3 +1,3 @@
|
||||
#Thu Aug 08 10:23:16 CEST 2024
|
||||
#Thu Nov 07 09:49:32 CET 2024
|
||||
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.8/apache-maven-3.9.8-bin.zip
|
||||
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
|
||||
|
||||
Vendored
+4
-2
@@ -99,15 +99,17 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) {
|
||||
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
|
||||
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) {
|
||||
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 " +
|
||||
"./mvnw -s settings.xml -Pci,artifactory " +
|
||||
"-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-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.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch " +
|
||||
"-Dmaven.test.skip=true clean deploy -U -B"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ set -euo pipefail
|
||||
export JENKINS_USER=${JENKINS_USER_NAME}
|
||||
|
||||
MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \
|
||||
./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch
|
||||
./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Java versions
|
||||
java.main.tag=17.0.12_7-jdk-focal
|
||||
java.main.tag=17.0.13_11-jdk-focal
|
||||
java.next.tag=22.0.2_9-jdk-jammy
|
||||
|
||||
# Docker container images - standard
|
||||
|
||||
+1
-2
@@ -3,9 +3,8 @@
|
||||
set -euo pipefail
|
||||
|
||||
mkdir -p /tmp/jenkins-home/.m2/spring-data-elasticsearch
|
||||
chown -R 1001:1001 .
|
||||
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
|
||||
-P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
<version>5.3.3</version>
|
||||
<version>5.3.6</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<version>3.3.6</version>
|
||||
</parent>
|
||||
|
||||
<name>Spring Data Elasticsearch</name>
|
||||
@@ -18,12 +18,11 @@
|
||||
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
|
||||
|
||||
<properties>
|
||||
<springdata.commons>3.3.3</springdata.commons>
|
||||
<springdata.commons>3.3.6</springdata.commons>
|
||||
|
||||
<!-- version of the ElasticsearchClient -->
|
||||
<elasticsearch-java>8.13.4</elasticsearch-java>
|
||||
|
||||
<blockhound-junit>1.0.8.RELEASE</blockhound-junit>
|
||||
<hoverfly>0.14.4</hoverfly>
|
||||
<log4j>2.18.0</log4j>
|
||||
<jsonassert>1.5.1</jsonassert>
|
||||
@@ -248,13 +247,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.projectreactor.tools</groupId>
|
||||
<artifactId>blockhound-junit-platform</artifactId>
|
||||
<version>${blockhound-junit}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.skyscreamer</groupId>
|
||||
<artifactId>jsonassert</artifactId>
|
||||
@@ -443,25 +435,6 @@
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>jdk13+</id>
|
||||
<!-- on jDK13+, Blockhound needs this JVM flag set -->
|
||||
<activation>
|
||||
<jdk>[13,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>-XX:+AllowRedefinitionToAddDeleteMethods</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>antora-process-resources</id>
|
||||
<build>
|
||||
|
||||
@@ -8,8 +8,8 @@ The following table shows the Elasticsearch and Spring versions that are used by
|
||||
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework
|
||||
| 2024.0 | 5.3.3 | 8.13.4 | 6.1.x
|
||||
| 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x
|
||||
| 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x
|
||||
| 2022.0 (Turing) | 5.0.xfootnote:oom[Out of maintenance] | 8.5.3 | 6.0.x
|
||||
| 2023.0 (Ullmann) | 5.1.xfootnote:oom[Out of maintenance] | 8.7.1 | 6.0.x
|
||||
| 2022.0 (Turing) | 5.0.xfootnote:oom[] | 8.5.3 | 6.0.x
|
||||
| 2021.2 (Raj) | 4.4.xfootnote:oom[] | 7.17.3 | 5.3.x
|
||||
| 2021.1 (Q) | 4.3.xfootnote:oom[] | 7.15.2 | 5.3.x
|
||||
| 2021.0 (Pascal) | 4.2.xfootnote:oom[] | 7.12.0 | 5.3.x
|
||||
|
||||
@@ -1021,6 +1021,9 @@ class RequestConverter extends AbstractQueryProcessor {
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (query.getRefresh() != null) {
|
||||
dqb.refresh(query.getRefresh());
|
||||
}
|
||||
dqb.allowNoIndices(query.getAllowNoIndices())
|
||||
.conflicts(conflicts(query.getConflicts()))
|
||||
.ignoreUnavailable(query.getIgnoreUnavailable())
|
||||
|
||||
@@ -345,8 +345,10 @@ public class MappingBuilder {
|
||||
: nestedPropertyPrefix + '.' + property.getFieldName();
|
||||
|
||||
Field fieldAnnotation = property.findAnnotation(Field.class);
|
||||
MultiField multiFieldAnnotation = property.findAnnotation(MultiField.class);
|
||||
|
||||
if (fieldAnnotation != null && fieldAnnotation.excludeFromSource()) {
|
||||
if ((fieldAnnotation != null && fieldAnnotation.excludeFromSource()) ||
|
||||
multiFieldAnnotation != null && multiFieldAnnotation.mainField().excludeFromSource()) {
|
||||
excludeFromSource.add(nestedPropertyPath);
|
||||
}
|
||||
|
||||
@@ -377,8 +379,6 @@ public class MappingBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
MultiField multiField = property.findAnnotation(MultiField.class);
|
||||
|
||||
if (isCompletionProperty) {
|
||||
CompletionField completionField = property.findAnnotation(CompletionField.class);
|
||||
applyCompletionFieldMapping(propertiesNode, property, completionField);
|
||||
@@ -386,8 +386,8 @@ public class MappingBuilder {
|
||||
|
||||
if (isRootObject && fieldAnnotation != null && property.isIdProperty()) {
|
||||
applyDefaultIdFieldMapping(propertiesNode, property);
|
||||
} else if (multiField != null) {
|
||||
addMultiFieldMapping(propertiesNode, property, multiField, isNestedOrObjectProperty, dynamicMapping);
|
||||
} else if (multiFieldAnnotation != null) {
|
||||
addMultiFieldMapping(propertiesNode, property, multiFieldAnnotation, isNestedOrObjectProperty, dynamicMapping);
|
||||
} else if (fieldAnnotation != null) {
|
||||
addSingleFieldMapping(propertiesNode, property, fieldAnnotation, isNestedOrObjectProperty, dynamicMapping);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ package org.springframework.data.elasticsearch.utils.geohash;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -84,7 +85,7 @@ public class Geohash {
|
||||
Assert.notNull(geohash, "geohash must not be null");
|
||||
|
||||
var point = Geohash.toPoint(geohash);
|
||||
return String.format("%f,%f", point.getLat(), point.getLon());
|
||||
return String.format(Locale.ROOT, "%f,%f", point.getLat(), point.getLon());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Spring Data Elasticsearch 5.3.3 (2024.0.3)
|
||||
Spring Data Elasticsearch 5.3.6 (2024.0.6)
|
||||
Copyright (c) [2013-2022] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
@@ -25,3 +25,6 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.blockhound;
|
||||
|
||||
import reactor.blockhound.BlockHound;
|
||||
import reactor.blockhound.BlockingOperationError;
|
||||
import reactor.blockhound.integration.BlockHoundIntegration;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
*/
|
||||
public class BlockHoundIntegrationCustomizer implements BlockHoundIntegration {
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(BlockHoundIntegrationCustomizer.class);
|
||||
|
||||
@Override
|
||||
public void applyTo(BlockHound.Builder builder) {
|
||||
// Elasticsearch classes reading from the classpath on initialization, needed for parsing Elasticsearch responses
|
||||
builder //
|
||||
.allowBlockingCallsInside("org.elasticsearch.Build", "<clinit>") //
|
||||
.allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "<clinit>") // pre 7.16
|
||||
.allowBlockingCallsInside("org.elasticsearch.common.XContentBuilder", "<clinit>") // from 7.16 on
|
||||
.allowBlockingCallsInside("org.elasticsearch.xcontent.json.JsonXContent", "contentBuilder") // from 7.16 on
|
||||
.allowBlockingCallsInside("jakarta.json.spi.JsonProvider", "provider") //
|
||||
;
|
||||
builder.blockingMethodCallback(it -> {
|
||||
LOGGER.error("BlockHound error", new Error(it.toString()));
|
||||
throw new BlockingOperationError(it);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.blockhound;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import reactor.blockhound.BlockingOperationError;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
*/
|
||||
public class BlockHoundTests {
|
||||
|
||||
@Test // #1822
|
||||
@DisplayName("should fail if BlockHound is not installed")
|
||||
void shouldFailIfBlockHoundIsNotInstalled() {
|
||||
|
||||
assertThatThrownBy(() -> {
|
||||
Mono.delay(Duration.ofMillis(1)).doOnNext(it -> {
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).block(); // should throw an exception about Thread.sleep
|
||||
}).hasCauseInstanceOf(BlockingOperationError.class);
|
||||
}
|
||||
}
|
||||
+17
@@ -30,12 +30,16 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter;
|
||||
import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
|
||||
import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext;
|
||||
import org.springframework.data.elasticsearch.core.query.Criteria;
|
||||
import org.springframework.data.elasticsearch.core.query.CriteriaQuery;
|
||||
import org.springframework.data.elasticsearch.core.query.DeleteQuery;
|
||||
import org.springframework.data.elasticsearch.core.query.DocValueField;
|
||||
import org.springframework.data.elasticsearch.core.query.StringQuery;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
* @author Han Seungwoo
|
||||
*/
|
||||
class RequestConverterTest {
|
||||
|
||||
@@ -72,6 +76,19 @@ class RequestConverterTest {
|
||||
assertThat(fieldAndFormats.get(1).format()).isEqualTo("format2");
|
||||
}
|
||||
|
||||
@Test // #2973
|
||||
@DisplayName("should set refresh based on deleteRequest")
|
||||
void refreshSetByDeleteRequest() {
|
||||
var query = new CriteriaQuery(new Criteria("text").contains("test"));
|
||||
var deleteQuery = DeleteQuery.builder(query).withRefresh(true).build();
|
||||
|
||||
var deleteByQueryRequest = requestConverter.documentDeleteByQueryRequest(deleteQuery, null, SampleEntity.class,
|
||||
IndexCoordinates.of("foo"),
|
||||
null);
|
||||
|
||||
assertThat(deleteByQueryRequest.refresh()).isTrue();
|
||||
}
|
||||
|
||||
@Document(indexName = "does-not-matter")
|
||||
static class SampleEntity {
|
||||
@Nullable
|
||||
|
||||
+47
-32
@@ -1090,38 +1090,49 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
|
||||
String expected = """
|
||||
{
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-date": {
|
||||
"type": "date",
|
||||
"format": "date"
|
||||
},
|
||||
"nestedEntity": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-text": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_source": {
|
||||
"excludes": [
|
||||
"excluded-date",
|
||||
"nestedEntity.excluded-text"
|
||||
]
|
||||
}
|
||||
}
|
||||
"""; //
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-date": {
|
||||
"type": "date",
|
||||
"format": "date"
|
||||
},
|
||||
"nestedEntity": {
|
||||
"type": "nested",
|
||||
"properties": {
|
||||
"_class": {
|
||||
"type": "keyword",
|
||||
"index": false,
|
||||
"doc_values": false
|
||||
},
|
||||
"excluded-text": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"excluded-multifield": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"_source": {
|
||||
"excludes": [
|
||||
"excluded-date",
|
||||
"nestedEntity.excluded-text",
|
||||
"excluded-multifield"
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
"""; //
|
||||
|
||||
String mapping = getMappingBuilder().buildPropertyMapping(ExcludedFieldEntity.class);
|
||||
|
||||
@@ -2395,6 +2406,10 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
excludeFromSource = true) private LocalDate excludedDate;
|
||||
@Nullable
|
||||
@Field(type = Nested) private NestedExcludedFieldEntity nestedEntity;
|
||||
@Nullable
|
||||
@MultiField(mainField = @Field(name = "excluded-multifield", type = Text, excludeFromSource = true), otherFields = {
|
||||
@InnerField(suffix = "keyword", type = Keyword)
|
||||
}) private String excludedMultifield;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
org.springframework.data.elasticsearch.blockhound.BlockHoundIntegrationCustomizer
|
||||
Reference in New Issue
Block a user