mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-07 20:52:10 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5ba1e5dc77 | ||
|
5ddcd55942 | ||
|
be4a77ad21 | ||
|
7fa3cb74a1 | ||
|
ba9edf8ec8 | ||
|
e4a39ae285 | ||
|
7392222793 |
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -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.3.x", threshold: hudson.model.Result.SUCCESS)
|
||||
}
|
||||
|
||||
options {
|
||||
|
8
pom.xml
8
pom.xml
@ -5,12 +5,12 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
<version>5.3.0</version>
|
||||
<version>5.3.1</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.3.1</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.3.0</springdata.commons>
|
||||
<springdata.commons>3.3.1</springdata.commons>
|
||||
|
||||
<!-- version of the ElasticsearchClient -->
|
||||
<elasticsearch-java>8.13.2</elasticsearch-java>
|
||||
<elasticsearch-java>8.13.4</elasticsearch-java>
|
||||
|
||||
<blockhound-junit>1.0.8.RELEASE</blockhound-junit>
|
||||
<hoverfly>0.14.4</hoverfly>
|
||||
|
@ -9,7 +9,7 @@
|
||||
*** xref:migration-guides/migration-guide-4.4-5.0.adoc[]
|
||||
*** xref:migration-guides/migration-guide-5.0-5.1.adoc[]
|
||||
*** xref:migration-guides/migration-guide-5.1-5.2.adoc[]
|
||||
|
||||
*** xref:migration-guides/migration-guide-5.2-5.3.adoc[]
|
||||
|
||||
* xref:elasticsearch.adoc[]
|
||||
** xref:elasticsearch/clients.adoc[]
|
||||
|
@ -1,6 +1,11 @@
|
||||
[[new-features]]
|
||||
= What's new
|
||||
|
||||
[[new-features.5-3-1]]
|
||||
== New in Spring Data Elasticsearch 5.3.1
|
||||
|
||||
* Upgrade to Elasticsearch 8.13.4.
|
||||
|
||||
[[new-features.5-3-0]]
|
||||
== New in Spring Data Elasticsearch 5.3
|
||||
|
||||
|
@ -6,7 +6,7 @@ The following table shows the Elasticsearch and Spring versions that are used by
|
||||
[cols="^,^,^,^",options="header"]
|
||||
|===
|
||||
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework
|
||||
| 2024.0 (?) | 5.3.x | 8.13.2 | ?
|
||||
| 2024.0 | 5.3.1 | 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
|
||||
|
@ -16,6 +16,7 @@
|
||||
package org.springframework.data.elasticsearch.client.elc;
|
||||
|
||||
import co.elastic.clients.elasticsearch._types.KnnQuery;
|
||||
import co.elastic.clients.elasticsearch._types.KnnSearch;
|
||||
import co.elastic.clients.elasticsearch._types.SortOptions;
|
||||
import co.elastic.clients.elasticsearch._types.aggregations.Aggregation;
|
||||
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
|
||||
@ -54,6 +55,7 @@ public class NativeQuery extends BaseQuery {
|
||||
|
||||
private Map<String, JsonData> searchExtensions = Collections.emptyMap();
|
||||
@Nullable private KnnQuery knnQuery;
|
||||
@Nullable private List<KnnSearch> knnSearches = Collections.emptyList();
|
||||
|
||||
public NativeQuery(NativeQueryBuilder builder) {
|
||||
super(builder);
|
||||
@ -71,6 +73,7 @@ public class NativeQuery extends BaseQuery {
|
||||
}
|
||||
this.springDataQuery = builder.getSpringDataQuery();
|
||||
this.knnQuery = builder.getKnnQuery();
|
||||
this.knnSearches = builder.getKnnSearches();
|
||||
}
|
||||
|
||||
public NativeQuery(@Nullable Query query) {
|
||||
@ -129,6 +132,14 @@ public class NativeQuery extends BaseQuery {
|
||||
return knnQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 5.3.1
|
||||
*/
|
||||
@Nullable
|
||||
public List<KnnSearch> getKnnSearches() {
|
||||
return knnSearches;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public org.springframework.data.elasticsearch.core.query.Query getSpringDataQuery() {
|
||||
return springDataQuery;
|
||||
|
@ -16,6 +16,7 @@
|
||||
package org.springframework.data.elasticsearch.client.elc;
|
||||
|
||||
import co.elastic.clients.elasticsearch._types.KnnQuery;
|
||||
import co.elastic.clients.elasticsearch._types.KnnSearch;
|
||||
import co.elastic.clients.elasticsearch._types.SortOptions;
|
||||
import co.elastic.clients.elasticsearch._types.aggregations.Aggregation;
|
||||
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
|
||||
@ -26,6 +27,7 @@ import co.elastic.clients.util.ObjectBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -52,6 +54,7 @@ public class NativeQueryBuilder extends BaseQueryBuilder<NativeQuery, NativeQuer
|
||||
|
||||
@Nullable private org.springframework.data.elasticsearch.core.query.Query springDataQuery;
|
||||
@Nullable private KnnQuery knnQuery;
|
||||
@Nullable private List<KnnSearch> knnSearches = Collections.emptyList();
|
||||
|
||||
public NativeQueryBuilder() {}
|
||||
|
||||
@ -92,6 +95,14 @@ public class NativeQueryBuilder extends BaseQueryBuilder<NativeQuery, NativeQuer
|
||||
return knnQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 5.3.1
|
||||
*/
|
||||
@Nullable
|
||||
public List<KnnSearch> getKnnSearches() {
|
||||
return knnSearches;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public org.springframework.data.elasticsearch.core.query.Query getSpringDataQuery() {
|
||||
return springDataQuery;
|
||||
|
@ -1719,7 +1719,18 @@ class RequestConverter extends AbstractQueryProcessor {
|
||||
;
|
||||
|
||||
if (query.getKnnQuery() != null) {
|
||||
builder.knn(query.getKnnQuery());
|
||||
var kq = query.getKnnQuery();
|
||||
builder.knn(ksb -> ksb
|
||||
.field(kq.field())
|
||||
.queryVector(kq.queryVector())
|
||||
.numCandidates(kq.numCandidates())
|
||||
.filter(kq.filter())
|
||||
.similarity(kq.similarity()));
|
||||
|
||||
}
|
||||
|
||||
if (!isEmpty(query.getKnnSearches())) {
|
||||
builder.knn(query.getKnnSearches());
|
||||
}
|
||||
|
||||
if (!isEmpty(query.getAggregations())) {
|
||||
@ -1740,7 +1751,18 @@ class RequestConverter extends AbstractQueryProcessor {
|
||||
.sort(query.getSortOptions());
|
||||
|
||||
if (query.getKnnQuery() != null) {
|
||||
builder.knn(query.getKnnQuery());
|
||||
var kq = query.getKnnQuery();
|
||||
builder.knn(ksb -> ksb
|
||||
.field(kq.field())
|
||||
.queryVector(kq.queryVector())
|
||||
.numCandidates(kq.numCandidates())
|
||||
.filter(kq.filter())
|
||||
.similarity(kq.similarity()));
|
||||
|
||||
}
|
||||
|
||||
if (!isEmpty(query.getKnnSearches())) {
|
||||
builder.knn(query.getKnnSearches());
|
||||
}
|
||||
|
||||
if (!isEmpty(query.getAggregations())) {
|
||||
|
@ -171,8 +171,8 @@ public final class MappingParameters {
|
||||
positiveScoreImpact = field.positiveScoreImpact();
|
||||
dims = field.dims();
|
||||
if (type == FieldType.Dense_Vector) {
|
||||
Assert.isTrue(dims >= 1 && dims <= 2048,
|
||||
"Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 2048.");
|
||||
Assert.isTrue(dims >= 1 && dims <= 4096,
|
||||
"Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 4096.");
|
||||
}
|
||||
Assert.isTrue(field.enabled() || type == FieldType.Object, "enabled false is only allowed for field type object");
|
||||
enabled = field.enabled();
|
||||
@ -214,8 +214,8 @@ public final class MappingParameters {
|
||||
positiveScoreImpact = field.positiveScoreImpact();
|
||||
dims = field.dims();
|
||||
if (type == FieldType.Dense_Vector) {
|
||||
Assert.isTrue(dims >= 1 && dims <= 2048,
|
||||
"Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 2048.");
|
||||
Assert.isTrue(dims >= 1 && dims <= 4096,
|
||||
"Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 4096.");
|
||||
}
|
||||
enabled = true;
|
||||
eagerGlobalOrdinals = field.eagerGlobalOrdinals();
|
||||
|
@ -1,4 +1,4 @@
|
||||
Spring Data Elasticsearch 5.3 GA (2024.0.0)
|
||||
Spring Data Elasticsearch 5.3.1 (2024.0.1)
|
||||
Copyright (c) [2013-2022] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
@ -22,3 +22,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -70,8 +70,8 @@ public class MappingParametersTest extends MappingContextBaseTests {
|
||||
}
|
||||
|
||||
@Test // #1700
|
||||
@DisplayName("should not allow dims length greater than 2048 for dense_vector type")
|
||||
void shouldNotAllowDimsLengthGreaterThan2048ForDenseVectorType() {
|
||||
@DisplayName("should not allow dims length greater than 4096 for dense_vector type")
|
||||
void shouldNotAllowDimsLengthGreaterThan4096ForDenseVectorType() {
|
||||
ElasticsearchPersistentEntity<?> failEntity = elasticsearchConverter.get().getMappingContext()
|
||||
.getRequiredPersistentEntity(DenseVectorInvalidDimsClass.class);
|
||||
Annotation annotation = failEntity.getRequiredPersistentProperty("dense_vector").findAnnotation(Field.class);
|
||||
@ -90,21 +90,28 @@ public class MappingParametersTest extends MappingContextBaseTests {
|
||||
}
|
||||
|
||||
static class AnnotatedClass {
|
||||
@Nullable @Field private String field;
|
||||
@Nullable @MultiField(mainField = @Field,
|
||||
@Nullable
|
||||
@Field private String field;
|
||||
@Nullable
|
||||
@MultiField(mainField = @Field,
|
||||
otherFields = { @InnerField(suffix = "test", type = FieldType.Text) }) private String mainField;
|
||||
@Nullable @Field(type = FieldType.Text, docValues = false) private String docValuesText;
|
||||
@Nullable @Field(type = FieldType.Nested, docValues = false) private String docValuesNested;
|
||||
@Nullable @Field(type = Object, enabled = true) private String enabledObject;
|
||||
@Nullable @Field(type = Object, enabled = false) private String disabledObject;
|
||||
@Nullable
|
||||
@Field(type = FieldType.Text, docValues = false) private String docValuesText;
|
||||
@Nullable
|
||||
@Field(type = FieldType.Nested, docValues = false) private String docValuesNested;
|
||||
@Nullable
|
||||
@Field(type = Object, enabled = true) private String enabledObject;
|
||||
@Nullable
|
||||
@Field(type = Object, enabled = false) private String disabledObject;
|
||||
}
|
||||
|
||||
static class InvalidEnabledFieldClass {
|
||||
@Nullable @Field(type = FieldType.Text, enabled = false) private String disabledObject;
|
||||
@Nullable
|
||||
@Field(type = FieldType.Text, enabled = false) private String disabledObject;
|
||||
}
|
||||
|
||||
static class DenseVectorInvalidDimsClass {
|
||||
@Field(type = Dense_Vector, dims = 2049) private float[] dense_vector;
|
||||
@Field(type = Dense_Vector, dims = 4097) private float[] dense_vector;
|
||||
}
|
||||
|
||||
static class DenseVectorMissingDimsClass {
|
||||
|
@ -15,7 +15,7 @@
|
||||
#
|
||||
#
|
||||
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
|
||||
sde.testcontainers.image-version=8.13.2
|
||||
sde.testcontainers.image-version=8.13.4
|
||||
#
|
||||
#
|
||||
# needed as we do a DELETE /* at the end of the tests, will be required from 8.0 on, produces a warning since 7.13
|
||||
|
Loading…
x
Reference in New Issue
Block a user