Skip to content

Conversation

sothawo
Copy link
Collaborator

@sothawo sothawo commented Mar 24, 2024

lazy intialization (which could probably only be done by a method interceptor on the repository proxy) is problematic in the reactive context, so we are not using this approach.

This PR adds the possibility to just skip the initialization of the data in Elasticsearch by setting the environment variable SPRING_DATA_ELASTICSEARCH_SKIP_REPOSITORY_INIT=true.

If an application needs to have the repository initialized when this property is set to true, the createIndexAndMappingIfNeeded() from the Simple(Reactive)ElasticsearchRepository must be explicitly called before writing data with the repository.

Closes #2876

@sothawo sothawo merged commit 7f17823 into spring-projects:main Mar 24, 2024
@sothawo sothawo deleted the #2876-skip-repo-init branch March 25, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make calls to create index and mapping in repositories (optionally) lazy.
1 participant