Bhargav
Bhargav

Reputation: 31

For Time-based data ,Can we use Time-based types rather than Time-based indexes in elastic search

As _ttl is depreciated in elastic search, If we cannot maintain time-based indices and want to maintain time-based data in elastic search, can we generate time-based types and delete them using cron job

Upvotes: 0

Views: 103

Answers (1)

Lusid
Lusid

Reputation: 4528

You certainly could, but I wouldn't recommend it. The advantage to using time-based indexes is that deleting an index completely wipes the data from the disk with no artifacts.

Deleting a type from an index is the same as deleting all of the individual documents relating to that type, which means the documents will simply be marked as deleted and eventually (maybe) merged away over time. Deleted documents remain a burden to the search performance because they are soft deletes and take up space in the index even when "deleted."

If this isn't a concern for you, then I would say there is nothing stopping you from creating time-based types and deleting them, but you lose all of the performance improvements that can come from keeping separate indexes.

Upvotes: 1

Related Questions