Issue
I would like to know how can I set a TTL so that each document older than 30 days are automatically removed by the ES cluster.
I know previous versions used to manage this using the TTL field but it seems it is removed now.
I'm using NEST.NET 6.4.0
Solution
TTL was removed in 5.0
you can use curator , shedule it as cronjob or jenkins job , and delete old indices all together.
curator_cli --host localhost --port 9200 --http_auth "$USER":"$PASS" \
delete_indices --ignore_empty_list --filter_list '[{"filtertype":"age","source":"creation_date","direction":"older","unit":"days","unit_count":30}, \
{"filtertype":"pattern","kind":"prefix","value":"livelogs"}]'
See also:
Is there a way to Set ttl in elastic search index
Answered By - Ijaz Ahmad Answer Checked By - Marilyn (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.