2

How can I configure Spring Data Elasticsearch to "rotate" indexes, such as for logstash for example?

I mean, with logstash we have an index for every day and refer to indexes as logstash-*. There a kind of index templating referenced in docs: https://www.elastic.co/guide/en/elasticsearch/guide/current/index-templates.html

Can I write something like:

@Document(indexName="index-{date_today}", ...)

Where date_today is exactly current date. How can I reproduce the same behavior with spring data elasticsearch?

0

1 Answer 1

0

In this case you cant use the index created by the annotation @Document, you have to manually create indexed using ElasticSearchTemplate.

I have answer this in Creating Indices name Dynamically in Elasticsearch using Spring-Data Elasticsearch

Not the answer you're looking for? Browse other questions tagged or ask your own question.