How to add ttl for the documents in an index

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Describe the issue:

I am trying to add a time for purging documents after a certain period. It looks like this has been removed! And it leaves me manually do it using delete_by_query and having a time of creation field in docs. I’m using open search java client. Is there anyone here knows why it is not there? Or I couldn’t find it!


Relevant Logs or Screenshots:

Most people use ISM: Index State Management - OpenSearch documentation

This requires you to roll over your indices frequently enough so that you drop indices older than X. It’s much more efficient than deleting by query, which triggers merges. More on merges here: Solr: Optimize Is (Not) Bad for You – Video & Slides

Thanks for the response. With IMS guide I need to create a policy first and then add it to the indices. I found no example on the internet of how to create and add policies using Java rest client.

The most comprehensive set of examples are listed here but there is no mention of policy.

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