1
0
mirror of synced 2026-05-23 20:53:17 +00:00

Compare commits

...

11 Commits

Author SHA1 Message Date
Greg L. Turnquist 1723fd24c3 Release version 4.4.11 (2021.2.11).
See #2498
2023-04-14 09:19:58 -05:00
Greg L. Turnquist 7b01fa3582 Prepare 4.4.11 (2021.2.11).
See #2498
2023-04-14 09:19:19 -05:00
Peter-Josef Meisch 27954e83c2 Polishing
(cherry picked from commit dfc1be286c)
(cherry picked from commit fdc03cf29e)
2023-04-10 11:55:52 +02:00
JKatzwinkel 6c4d101b46 Fix inner hits metadata mapping.
Original Pull Request #2522
Closes #2521

(cherry picked from commit 1f7fa77c15)
(cherry picked from commit e1da43ca9f)
2023-04-10 11:55:51 +02:00
Mark Paluch 48d77796ab Upgrade to Maven Wrapper 3.9.1.
See #2520
2023-04-06 16:18:44 +02:00
Christoph Strobl 96a4605361 After release cleanups.
See #2484
2023-03-20 13:48:10 +01:00
Christoph Strobl 144ae6d7d1 Prepare next development iteration.
See #2484
2023-03-20 13:48:09 +01:00
Christoph Strobl 7c429c4a94 Release version 4.4.10 (2021.2.10).
See #2484
2023-03-20 13:43:05 +01:00
Christoph Strobl 08ec702138 Prepare 4.4.10 (2021.2.10).
See #2484
2023-03-20 13:42:32 +01:00
Mark Paluch 91af6fefde After release cleanups.
See #2461
2023-03-03 10:22:38 +01:00
Mark Paluch 823c164ae7 Prepare next development iteration.
See #2461
2023-03-03 10:22:36 +01:00
5 changed files with 23 additions and 12 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
#Mon Feb 20 12:02:21 CET 2023
#Thu Apr 06 16:18:44 CEST 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.0/apache-maven-3.9.0-bin.zip
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
+3 -3
View File
@@ -5,12 +5,12 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>4.4.9</version>
<version>4.4.11</version>
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.7.9</version>
<version>2.7.11</version>
</parent>
<name>Spring Data Elasticsearch</name>
@@ -24,7 +24,7 @@
<elasticsearch-java>7.17.9</elasticsearch-java>
<log4j>2.17.1</log4j>
<netty>4.1.65.Final</netty>
<springdata.commons>2.7.9</springdata.commons>
<springdata.commons>2.7.11</springdata.commons>
<testcontainers>1.16.2</testcontainers>
<blockhound-junit>1.0.6.RELEASE</blockhound-junit>
<java-module-name>spring.data.elasticsearch</java-module-name>
@@ -45,6 +45,7 @@ import org.springframework.util.Assert;
* @author Roman Puchkovskiy
* @author Matt Gilene
* @author Sascha Woo
* @author Jakob Hoeper
* @since 4.0
*/
public class SearchHitMapping<T> {
@@ -197,9 +198,10 @@ public class SearchHitMapping<T> {
}
try {
ElasticsearchPersistentEntity<?> persistentEntityForType = mappingContext.getPersistentEntity(type);
NestedMetaData nestedMetaData = searchHits.getSearchHit(0).getContent().getNestedMetaData();
ElasticsearchPersistentEntityWithNestedMetaData persistentEntityWithNestedMetaData = getPersistentEntity(
mappingContext.getPersistentEntity(type), nestedMetaData);
persistentEntityForType, nestedMetaData);
if (persistentEntityWithNestedMetaData.entity != null) {
List<SearchHit<Object>> convertedSearchHits = new ArrayList<>();
@@ -217,7 +219,8 @@ public class SearchHitMapping<T> {
searchDocument.getSortValues(), //
searchDocument.getHighlightFields(), //
searchHit.getInnerHits(), //
persistentEntityWithNestedMetaData.nestedMetaData, //
getPersistentEntity(persistentEntityForType, //
searchHit.getContent().getNestedMetaData()).nestedMetaData, //
searchHit.getExplanation(), //
searchHit.getMatchedQueries(), //
targetObject));
+3 -1
View File
@@ -1,4 +1,4 @@
Spring Data Elasticsearch 4.4.9 (2021.2.9)
Spring Data Elasticsearch 4.4.11 (2021.2.11)
Copyright (c) [2013-2021] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -44,6 +44,8 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
@@ -42,6 +42,7 @@ import org.springframework.lang.Nullable;
* Testing the querying and parsing of inner_hits.
*
* @author Peter-Josef Meisch
* @author Jakob Hoeper
*/
@SpringIntegrationTest
public abstract class InnerHitsIntegrationTests {
@@ -58,8 +59,9 @@ public abstract class InnerHitsIntegrationTests {
indexOps.createWithMapping();
Inhabitant john = new Inhabitant("John", "Smith");
Inhabitant carla = new Inhabitant("Carla", "Miller");
House cornerHouse = new House("Round the corner", "7", Arrays.asList(john, carla));
Inhabitant carla1 = new Inhabitant("Carla", "Miller");
Inhabitant carla2 = new Inhabitant("Carla", "Nguyen");
House cornerHouse = new House("Round the corner", "7", Arrays.asList(john, carla1, carla2));
City metropole = new City("Metropole", Arrays.asList(cornerHouse));
Inhabitant jack = new Inhabitant("Jack", "Wayne");
@@ -76,7 +78,7 @@ public abstract class InnerHitsIntegrationTests {
operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete();
}
@Test
@Test // #2521
void shouldReturnInnerHits() {
Query query = buildQueryForInnerHits("inner_hit_name", "hou-ses.in-habi-tants", "hou-ses.in-habi-tants.first-name",
@@ -91,7 +93,7 @@ public abstract class InnerHitsIntegrationTests {
softly.assertThat(searchHit.getInnerHits()).hasSize(1);
SearchHits<?> innerHits = searchHit.getInnerHits("inner_hit_name");
softly.assertThat(innerHits).hasSize(1);
softly.assertThat(innerHits).hasSize(2);
SearchHit<?> innerHit = innerHits.getSearchHit(0);
Object content = innerHit.getContent();
@@ -106,6 +108,10 @@ public abstract class InnerHitsIntegrationTests {
softly.assertThat(nestedMetaData.getChild().getField()).isEqualTo("inhabitants");
softly.assertThat(nestedMetaData.getChild().getOffset()).isEqualTo(1);
innerHit = innerHits.getSearchHit(1);
softly.assertThat(((Inhabitant) innerHit.getContent()).getLastName()).isEqualTo("Nguyen");
softly.assertThat(innerHit.getNestedMetaData().getChild().getOffset()).isEqualTo(2);
softly.assertAll();
}