Delete orphan Data stream's backing index when all records are deleted

Hello,

We're using Elasticsearch version 7.17.6. We are new to the Elasticsearch time series data stream, hoping to find answers to some of the queries.

  1. What happens when we delete all the records within a backing index? Does the index get deleted as well?

  2. Without a life cycle policy, is it possible to delete a backing index where all documents/records within the index are deleted and the index has reached a certain age?

We've previously gone through these docs.

Any help on these queries is appreciated.

Thank you,
Tejas Talekar

No, index will not get deleted if you delete all documents.

Are you deleting documents from the data stream?

Also, de first documentation that you shared if for the Elasticsearch Serverless offering, it is a cloud service that is pretty new and a little different, not sure even if it is available for everyone.

You may read this documentation about data streams: Data streams | Elasticsearch Guide [7.17] | Elastic

Data Streams are designed to be append only, you can update and delete documents, but you would need to make requests directly to the backing indice.

No, lifecycle policy works on entire indices, not documents, you can delete an entire index after some age, but it doesn't matter if it is empty or not, the only thing that matters is the age.

1 Like

Hi @leandrojmp ,

Thank you so much for your response—it provided great insights and clarified my questions. I truly appreciate your help!

Warm Regards,

Tejas Talekar