Elasticsearch 的索引按天切割可以通过设置索引的格式来实现。一般采用以下格式:

'<index_name>'-'<year>'.<month>.<day>

其中,'<index_name>' 为索引名称,'' 为年份,'' 为月份,'' 为天数。例如,如果你的索引名称为 logs,那么当天的索引名称为 logs-2022.05.25。

这样设置可以方便地对每天的数据进行管理和查询。另外,也可以设置定时任务,每天自动创建当天的索引。

Elasticsearch 索引按天切割的最佳实践

原文地址: https://www.cveoy.top/t/topic/oPMo 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录