Skip to content

Provide configuration property for the refresh policy of ReactiveElasticsearchTemplate #30379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wilkinsona opened this issue Mar 22, 2022 · 7 comments
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

See #30096 and #30378 for background. To make it easier for users to configure the refresh policy and indices options of the auto-configured ReactiveElasticsearchTemplate, it would be good to provide configuration properties for those two settings.

There's no existing @ConfigurationProperties class to which these new properties could be added so we'll need to consider where we want the properties to go. The only Data Elasticsearch property that we have at the moment is spring.data.elasticsearch.repositories.enabled. The new properties should probably go beneath spring.data.elasticsearch.template.reactive or spring.data.elasticsearch.reactive.template.

@wilkinsona wilkinsona added the type: enhancement A general enhancement label Mar 22, 2022
@wilkinsona wilkinsona added this to the 2.x milestone Mar 22, 2022
@wilkinsona wilkinsona added the status: pending-design-work Needs design work before any code can be developed label Mar 22, 2022
@wilkinsona wilkinsona changed the title Provide configuration properties for the refresh policy and indices options of ReactiveElasticsearchTemplate Provide configuration property for the refresh policy of ReactiveElasticsearchTemplate Jul 23, 2022
@wilkinsona wilkinsona modified the milestones: 2.x, 3.x Jul 23, 2022
@wilkinsona
Copy link
Member Author

wilkinsona commented Jul 23, 2022

The new ReativeElasticsearchTemplate does not have configurable indices options so this issue's now scoped to only the refresh policy.

@maroov
Copy link

maroov commented Apr 3, 2023

Hi,
Is there any news regarding this?
We recently migrated to Spring Boot 3 & Elastic 8 and so far have been unable to find a way to set the index options to "Lenient Expand Open" like we used to do with the old Template.

@scottfrederick
Copy link
Contributor

@maroov Any news would be reflected in comments on this issue or changes in tags applied to it. Unfortunately this issue just hasn't risen to the top of our priority list.

@hantsy
Copy link

hantsy commented Oct 8, 2023

When the refresh policy is changed to null, it failed my tests in Data Elasticsearch example projects, the data saved in the before setup method is not found in the tests at all.

@wilkinsona
Copy link
Member Author

When the refresh policy is changed to null

What is changing it to null? AFAIK, Spring Boot does not do that.

@wilkinsona
Copy link
Member Author

@maroov I don't think this issue is going to provide what you want. There's no setter for the index options on org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchTemplate so, as far as we know, Spring Boot will not be able to configure it. Looking at spring-projects/spring-data-elasticsearch#2639, I think the intention is that the options are configured when your application creates its queries. You may want to follow up with the Spring Data Elasticsearch team. This is out of Spring Boot's control.

@keyzj

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants