spring-projects / spring-data-elasticsearch

Provide support to increase developer productivity in Java when using Elasticsearch. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-elasticsearch/
Apache License 2.0
2.9k stars 1.33k forks source link

Settings of an index outside thé entity annotation #2886

Closed bameline closed 5 months ago

bameline commented 5 months ago

I tried to find a wat to put settings on my index beside using @setting annotation. I want to set a refreshinterval before indexation and another After. IS there a way to do that?

sothawo commented 5 months ago

You can always get or set index settings by using the methods from IndexOperations (https://docs.spring.io/spring-data/elasticsearch/docs/current/api/org/springframework/data/elasticsearch/core/IndexOperations.html).

So you could read the current settings, set a different refresh intervall, do the indexing and after that reset to the original value.