From 99d27e0d1f8e7574d4c7fe344fbcdcf8eef82eaa Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 10 May 2024 09:32:14 +0200 Subject: [PATCH] Fix implementation of explicit refresh policy. Closes #29907 --- .../repository/support/SimpleElasticsearchRepository.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java index c5c17d8a8..e4d1da6e2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java @@ -457,9 +457,7 @@ public R executeAndRefresh(OperationsCallback callback) { @Nullable public R executeAndRefresh(OperationsCallback callback, @Nullable RefreshPolicy refreshPolicy) { - R result = callback.doWithOperations(operations.withRefreshPolicy(refreshPolicy)); - doRefresh(); - return result; + return callback.doWithOperations(operations.withRefreshPolicy(refreshPolicy)); } // endregion }