User tests: Successful: Unsuccessful:
Fixes #47625
This PR fixes a delay in Smart Search (com_finder) where newly created content is not immediately searchable.
The issue was caused by truncating seconds from the current timestamp (nowDate) using:
substr_replace(Factory::getDate()->toSql(), '00', -2)
This caused newly created content within the same minute to be treated as "future content", resulting in a delay of up to one minute before appearing in search results.
The fix removes this truncation and uses the full timestamp including seconds:
Factory::getDate()->toSql()
This ensures accurate time comparison and immediate visibility of new content in Smart Search.
🎥 Before Fix (Video)
🎥 After Fix (Video)
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End com_finder |
Besides that, this PR changes the code but leaves the comment one line above unchanged:
// Get the current date, minus seconds.
So the comment becomes wrong.
Finally, I do not even think that the referenced issue #47625 which this PR tries to solve is an issue. It should be closed as expected behaviour. But that's just my personal opinion.
Indeed, this is intended behavior. We want to prevent the query cache of MySQL to always miss, just because the seconds of that part of the query change. com_content does the same afaik.
@devesht-ML Thank you for your PR.
However, as the developers are of the opinion that this behaviour is intended, I will close the issue.
Indeed, this is intended behavior. We want to prevent the query cache of MySQL to always miss, just because the seconds of that part of the query change. com_content does the same afaik.
just at note, mysql has no query cache since 8.0, but still valid for mariadb and postgres afaik
i assume that the seconds were removed for a reason and not just for fun