Skip to content

Commit ea51ce0

Browse files
committed
Fix missing return value in ByQueryResponse.
Original Pull Request #3109 Closes #3108 Signed-off-by: Peter-Josef Meisch <[email protected]> (cherry picked from commit ebbe242)
1 parent 4767a82 commit ea51ce0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java

+4
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,10 @@ public ByQueryResponse byQueryResponse(UpdateByQueryResponse response) {
500500
builder.withDeleted(response.deleted());
501501
}
502502

503+
if(response.updated() != null) {
504+
builder.withUpdated(response.updated());
505+
}
506+
503507
if (response.batches() != null) {
504508
builder.withBatches(Math.toIntExact(response.batches()));
505509
}

src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,9 @@ void shouldDoUpdateByQueryForExistingDocument() {
16361636
.withParams(Collections.singletonMap("newMessage", messageAfterUpdate)).withAbortOnVersionConflict(true)
16371637
.build();
16381638

1639-
operations.updateByQuery(updateQuery, IndexCoordinates.of(indexNameProvider.indexName()));
1639+
var byQueryResponse = operations.updateByQuery(updateQuery, IndexCoordinates.of(indexNameProvider.indexName()));
1640+
1641+
assertThat(byQueryResponse.getUpdated()).isEqualTo(1);
16401642

16411643
SampleEntity indexedEntity = operations.get(documentId, SampleEntity.class,
16421644
IndexCoordinates.of(indexNameProvider.indexName()));

0 commit comments

Comments
 (0)