Delete documents from index based on timestamp

I have a huge index and I want to delete/archive documents from a huge index based on timestamp.

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html

DeleteByQuery can be used. but its a very slow process.

Thank you Ravi.

Is there any internal time stamp that these documents contain while getting created so that i can put a query to delete the documents older than 3 days

Also, I am using Elastic Search 1.7.3 version. Is delete_by_query available for this version?

https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-delete-by-query.html

Its available in that version. But depreciated. Please have a look.

Can you please answer the below question as well.

Is there any internal time stamp that these documents contain while getting created so that i can put a query to delete the documents older than 3 days

If you want to keep only 3 days of data, might be better to reindex to a new index the 3 days and drop the old one.

Probably more efficient...

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