We want to automatically delete some document with different expiration dates

How to let elasticsearch5.5.2 automatic delete document by some datetime field.
The _ttl mappings have been removed from 5.x. because effifient problem.
Is there any other way I can delete expired files automatically?

The best option these days is to use time based indices, and then just remove them after the expiration time.

Also you really need to upgrade, 5.X is EOL and no longer supported

1 Like

If the TTL does not change over time I would recommend time based indices as it is the most efficient way to delete data from Elasticsearch. If there are updates changing it I believe you will need to find a way to schedule delete by query requests, which is what the TTL functionality did behind the scenes. This suffers from the same performance problems as TTL as it is an expensive way to delete large amounts of data.

1 Like

I'm a newer for ES.
So there is no way to automatically delete document, but can delete index automatically.
And I don't know how to use time-based indices. I need to study it.
So can you give me some advice?
thanks very much.

Check out ILM, it's the best approach.

Thank you for your help.
It's pity, we must do this job on the ES 5.5.
This version is not support ILM.
We have to use time-based indices or delete by query API.
There seems to be no other choice here.

You really need to upgrade, 5.X is no longer supported. The latest version is 7.8!

I want to talk about that with my leader.
But I think there will be no results, at least there will be no results in the near future.
We have just accepted these jobs not long ago.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.