From 049bcf504ea1be816ac8de939bc5f48a53daea97 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 3 Nov 2022 19:49:48 +0100 Subject: [PATCH] Use custom refresh policy in reactive repository with all clients. Original Pull Request #2350 Closes #2349 --- .../support/SimpleReactiveElasticsearchRepository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java index dafc5046..70765a10 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java @@ -22,7 +22,7 @@ import org.reactivestreams.Publisher; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.client.erhlc.NativeSearchQueryBuilder; -import org.springframework.data.elasticsearch.client.erhlc.ReactiveElasticsearchTemplate; +import org.springframework.data.elasticsearch.core.AbstractReactiveElasticsearchTemplate; import org.springframework.data.elasticsearch.core.MultiGetItem; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.core.ReactiveIndexOperations; @@ -245,8 +245,8 @@ public class SimpleReactiveElasticsearchRepository implements ReactiveEla private Mono doRefresh() { RefreshPolicy refreshPolicy = null; - if (operations instanceof ReactiveElasticsearchTemplate) { - refreshPolicy = ((ReactiveElasticsearchTemplate) operations).getRefreshPolicy(); + if (operations instanceof AbstractReactiveElasticsearchTemplate template) { + refreshPolicy = template.getRefreshPolicy(); } if (refreshPolicy == null) {