For example I want to create time based index. In elastic search we can achieve this by creating a pattern.
curl -XPUT 'localhost:9200/_template/indextemplate' -d '{
"template": "dynamicIndex-*",
"order": 0,
"settings": {
"index": {
"number_of_shards": 2,
"number_of_replicas": 2
}
}
}
In the above example the settings and mappings will apply on "dynamicIndex-". So now I can create weekly indexes like dynamicIndex-1, dyanmicIndex-2. How can I achieve this using spring data(How create/set the index template in using spring data).