弹性search创build基于时间的索引

根据基于时间的数据 ,使用这种方法主要有两种情况。 首先是日志logging,es与Logstash集成,默认情况下每天创build一个新的索引。

但是,我处于创build社交networking活动指标的第二个条件,每三个月自动创build一个指标,即指数名称为data-01data-04data-07

我search弹性弹性search参考2.1和弹性search:权威指南很多。 我没有什么帮助。

希望任何能够给我提供线索或提示的人。

您可以使用Curator创build基于时间的索引。 馆长让您创build/删除索引,创build别名等

所以基本上你可以做到以下几点:

1> create an alias which will be used to save data into ES. 2> create a script which will create an index using the current date. 3> detach last months index from the save alias 4> attached the newly created index to your save alias. 5> drop older indices more thatn 30/60/90 days or according to your requirements. 6> write a cron job which will run every month and run this script above. 

因此,您每个月都会将数据保存到一个新的索引中。

 7> create another alias for searching with something like indexname* so that it searches across all your existing indices.