dotCMS / dotCMS/core

Store last read date in index metadata

Open
#37,517 0 comments 0 reactions 1 assignee View on GitHub

@fabrizzio-dotCMS is already working on this.

Since Sep 11, 2026.

OpenSearch Team : Scout
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem

Indexes - especially site search indexes - are not strongly consistent with any data in dotCMS db - meaning we have no record of which indexes are actually being used. Some have aliases but not all. This presents a problem when trying to clean up older site search indexes - we run the risk of deleting an index that is actually being used for search results. We need a way to keep track of which indexes have been recently used and which indexes are just sitting there taking up space.

The idea is that when an index is read from in dotCMS, we add it a Set<String> of the index names that is stored in java memory. Every night, we have a job that reads that set, clears it and then updates the touched index metadata with the last_read_date (YY-MM-DD).

Once an index is no longer in use, that date will not be updated and naturally age out and we can write a quick cronjob that prunes unread indexes that are greater than X days.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.