Skip to content

Commit ebbe242

Browse files
authored
Fix missing return value in ByQueryResponse.
Original Pull Request #3109 Closes #3108 Signed-off-by: Peter-Josef Meisch <[email protected]>
1 parent 0ce9a1c commit ebbe242

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ public ByQueryResponse byQueryResponse(UpdateByQueryResponse response) {
498498
builder.withDeleted(response.deleted());
499499
}
500500

501+
if(response.updated() != null) {
502+
builder.withUpdated(response.updated());
503+
}
504+
501505
if (response.batches() != null) {
502506
builder.withBatches(Math.toIntExact(response.batches()));
503507
}

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

Lines changed: 3 additions & 1 deletion
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)