Throughout a number of DSpace 5 related upgrade and module installation projects of the past months, we have seen an unusual degradation of the discovery indexing process. From a number of hours, we're seeing degradation to a number of days. In many cases, the process also hits out of memory errors.
We have reason to believe that it's related to https://jira.duraspace.org/browse/DS-1582
This would ideally be fixed in a DSpace 5.4 release. This is not relevant for DSpace 6, since the new service API changes the underlying implementation anyhow.