例如,我想創建基於時間的索引。在彈性搜索中,我們可以通過創建一個模式來實現。如何使用彈簧數據在elasticsearch中創建動態模板。
curl -XPUT 'localhost:9200/_template/indextemplate' -d '{
"template": "dynamicIndex-*",
"order": 0,
"settings": {
"index": {
"number_of_shards": 2,
"number_of_replicas": 2
}
}
}
在上例中,設置和映射將應用於「dynamicIndex-」。所以現在我可以創建像dynamicIndex-1,dyanmicIndex-2這樣的每週索引。 如何使用彈簧數據實現這一點(如何使用彈簧數據創建/設置索引模板)。
與定義與彈簧數據elasticsearch動態模板任何運氣? –
https://github.com/spring-projects/spring-data-elasticsearch/pull/132#issuecomment-254476072現在添加動態模板註釋。 –