1
0
mirror of synced 2026-05-25 13:43:18 +00:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Mark Paluch 3f085b2675 Release version 5.1.3 (2023.0.3).
See #2631
2023-08-18 14:04:04 +02:00
Mark Paluch 42aeb48b43 Prepare 5.1.3 (2023.0.3).
See #2631
2023-08-18 14:03:49 +02:00
Julia Lee 449910b4f7 Update CI properties.
See #2631
2023-08-14 11:29:43 -04:00
Julia Lee 2e99f5b2e0 Upgrade to Maven Wrapper 3.9.4.
See #2669
2023-08-14 07:55:32 -04:00
Peter-Josef Meisch 9b9136d852 Fix similarity field mapping.
Original Pull Request #2666
Closes #2659

(cherry picked from commit 8c5ff92cd2)
2023-08-13 21:40:31 +02:00
Peter-Josef Meisch a266d7c46a Upgrade deprecated dependency to Elasticsearch 7.17.12.
Original Pull Request #2655
#Closes #2651
2023-07-30 19:51:01 +02:00
Peter-Josef Meisch c045a8ae29 Fix MappingElasticsearchConverter.
Original Pull Request #2637
Closes #2627

(cherry picked from commit d9bb9911f9)
2023-07-18 22:51:45 +02:00
Mark Paluch 11c87a1251 After release cleanups.
See #2595
2023-07-14 13:57:59 +02:00
Mark Paluch c9e9bf757e Prepare next development iteration.
See #2595
2023-07-14 13:57:58 +02:00
8 changed files with 87 additions and 19 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
#Mon Jul 03 09:48:29 CEST 2023
#Mon Aug 14 07:55:32 EDT 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.3/apache-maven-3.9.3-bin.zip
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
+5 -5
View File
@@ -1,5 +1,5 @@
# Java versions
java.main.tag=17.0.7_7-jdk-focal
java.main.tag=17.0.8_7-jdk-focal
java.next.tag=20-jdk-jammy
# Docker container images - standard
@@ -7,12 +7,12 @@ docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/ecli
docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.next.tag}
# Supported versions of MongoDB
docker.mongodb.4.4.version=4.4.22
docker.mongodb.5.0.version=5.0.18
docker.mongodb.6.0.version=6.0.7
docker.mongodb.4.4.version=4.4.23
docker.mongodb.5.0.version=5.0.19
docker.mongodb.6.0.version=6.0.8
# Supported versions of Redis
docker.redis.6.version=6.2.12
docker.redis.6.version=6.2.13
# Supported versions of Cassandra
docker.cassandra.3.version=3.11.15
+4 -4
View File
@@ -5,12 +5,12 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>5.1.2</version>
<version>5.1.3</version>
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>3.1.2</version>
<version>3.1.3</version>
</parent>
<name>Spring Data Elasticsearch</name>
@@ -18,10 +18,10 @@
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
<properties>
<springdata.commons>3.1.2</springdata.commons>
<springdata.commons>3.1.3</springdata.commons>
<!-- version of the RestHighLevelClient -->
<elasticsearch-rhlc>7.17.11</elasticsearch-rhlc>
<elasticsearch-rhlc>7.17.12</elasticsearch-rhlc>
<!-- version of the new ElasticsearchClient -->
<elasticsearch-java>8.7.1</elasticsearch-java>
@@ -919,7 +919,7 @@ public class MappingElasticsearchConverter
Class<?> elementType = element == null ? null : element.getClass();
if (elementType == null || conversions.isSimpleType(elementType)) {
if (elementType == null || isSimpleType(elementType)) {
collection.add(getPotentiallyConvertedSimpleWrite(element,
componentType != null ? componentType.getType() : Object.class));
} else if (element instanceof Collection || elementType.isArray()) {
@@ -332,6 +332,8 @@ public final class MappingParameters {
if (!Similarity.Default.equals(similarity)) {
objectNode.put(FIELD_PARAM_SIMILARITY, similarity);
// similarity must have index explicitly set, otherwise Elasticsearch returns an error
objectNode.put(FIELD_PARAM_INDEX, index);
}
if (termVector != TermVector.none) {
+2 -1
View File
@@ -1,4 +1,4 @@
Spring Data Elasticsearch 5.1.2 (2023.0.2)
Spring Data Elasticsearch 5.1.3 (2023.0.3)
Copyright (c) [2013-2022] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -15,3 +15,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
@@ -909,6 +909,55 @@ public class MappingElasticsearchConverterUnitTests {
assertEquals(expected, document.toJson(), false);
}
@Test // #2627
@DisplayName("should write Map containing collection containing map")
void shouldWriteMapContainingCollectionContainingMap() throws JSONException {
class EntityWithMapCollectionMap {
Map<String, Object> map;
}
class InnerEntity {
String prop1;
String prop2;
public InnerEntity() {}
public InnerEntity(String prop1, String prop2) {
this.prop1 = prop1;
this.prop2 = prop2;
}
}
var entity = new EntityWithMapCollectionMap();
entity.map = Collections.singletonMap("collection",
Collections.singletonList(Collections.singletonMap("destination", new InnerEntity("prop1", "prop2"))));
var expected = """
{
"_class": "org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverterUnitTests$1EntityWithMapCollectionMap",
"map": {
"collection": [
{
"destination": {
"_class": "org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverterUnitTests$1InnerEntity",
"prop1": "prop1",
"prop2": "prop2"
}
}
]
}
}
""";
Document document = Document.create();
mappingElasticsearchConverter.write(entity, document);
assertEquals(expected, document.toJson(), false);
}
@Nested
class RangeTests {
@@ -1953,12 +2002,12 @@ public class MappingElasticsearchConverterUnitTests {
@Language("JSON")
var expected = """
{
"_class": "org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverterUnitTests$FieldNameDotsEntity",
"id": "42",
"dotted.field": "dotted field"
}
""";
{
"_class": "org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverterUnitTests$FieldNameDotsEntity",
"id": "42",
"dotted.field": "dotted field"
}
""";
var entity = new FieldNameDotsEntity();
entity.setId("42");
entity.setDottedField("dotted field");
@@ -3192,6 +3241,7 @@ public class MappingElasticsearchConverterUnitTests {
this.mapToNotWriteWhenEmpty = mapToNotWriteWhenEmpty;
}
}
static class FieldNameDotsEntity {
@Id
@Nullable private String id;
@@ -287,6 +287,12 @@ public abstract class MappingBuilderIntegrationTests extends MappingContextBaseT
indexOps.createWithMapping();
}
@Test // #2659
@DisplayName("should write correct mapping for dense vector property")
void shouldWriteCorrectMappingForDenseVectorProperty() {
operations.indexOps(SimilarityEntity.class).createWithMapping();
}
// region Entities
@Document(indexName = "#{@indexNameProvider.indexName()}")
static class Book {
@@ -916,5 +922,14 @@ public abstract class MappingBuilderIntegrationTests extends MappingContextBaseT
@Nullable
@Field(name = "dotted.field", type = Text) private String dottedField;
}
@Document(indexName = "#{@indexNameProvider.indexName()}")
static class SimilarityEntity {
@Nullable
@Id private String id;
@Field(type = FieldType.Dense_Vector, dims = 42, similarity = "cosine") private double[] denseVector;
}
// endregion
}