Home > other >  Is it possible to register document lifecycle in elasticsearch?
Is it possible to register document lifecycle in elasticsearch?

Time:03-15

I want to create a function that creates token documents in elasticsearch and gives them token lifecycle just like in redis and deletes them automatically over time.

Does Elasticsearch support that feature?

CodePudding user response:

In ES 2.0 (looooong time ago), there used to be a _ttl metadata field that served exactly this purpose.

That feature has been deprecated in favor of using an index per timeframe (hourly, daily, weekly, monthly, etc) and Index Lifecycle Management to manage the lifecycle of data.

You should be able to achieve what you want with proper time-based indices and an appropriate index lifecycle policy managing those indices.

  • Related