You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible to add a refresh method into the ElasticsearchRepository/ElasticsearchOperations(both blocking and reactive) to allow developers to sync the data by force, make it available for search after the refresh is called.
interfacePostRepositoryextendsReactiveElasticsearchRepository<Post, String> {
}
// posts is PostRepository beanthis.posts
.saveAll(
List.of(
Post.builder().title("Post one").content("content of post one").build(),
Post.builder().title("Post two").content("content of post two").build()
)
)
.doOnTerminate(() -> {
log.debug("terminating...");
this.posts.refresh().then(); // sync the indices by force.
})
.doOnComplete(() -> {
log.debug("completing...");
})
.subscribe(data -> {
log.debug("saved data: {}", data);
});
Similar to the flush in JPA and Spring Data JPA, add some convenient methods to ElasticsearchRepository/ElasticsearchOperations.
saveAndRefresh()
saveAllAndRefresh()
refresh()
bulkUpdateAndRefresh()
...
The text was updated successfully, but these errors were encountered:
Spring Boot still does not provides a property to configure the refresh policy, see: spring-projects/spring-boot#30379
I have to configure the RefreshPolicy to IMMEDIATE through the Spring Data base configuration class to make my Data Elasticsearch example tests to get passed.
If possible to add a
refresh
method into the ElasticsearchRepository/ElasticsearchOperations(both blocking and reactive) to allow developers to sync the data by force, make it available for search after the refresh is called.Similar to the flush in JPA and Spring Data JPA, add some convenient methods to
ElasticsearchRepository/ElasticsearchOperations
.The text was updated successfully, but these errors were encountered: