Skip to content

Content not found up to 'One minute' with com_finder #47625

@MrMusic

Description

@MrMusic

When new content is created, it can take up to one minute for the content to appear in search results on the frontend.
This applies to articles (com_content) and content from extensions.
The issue only occurs with new content, not when modifying existing content.

Testing instructions

Example: Create a new article, e.g. at 12:00:05.
Start a search for this article in the frontend in the same minute (still at 12:00:xx).

Expected result

The article is found immediately.

Actual result

The article is not found at 12:00:xx, but after 12:01:00.
I suspect the cause lies in line 177 of the file searchmodel.php:

// Get the current date, minus seconds.
$nowDate = $db->quote(substr_replace(Factory::getDate()->toSql(), '00', -2));

Is there a specific reason for this change to the time ($nowDate)?
On a normal (live) website, this delay is probably not a problem.
However, if developers/testers create content for testing purposes, for example to test a finder plugin, this can lead to confusion.

System Information

Tested with Joomla 5.4.5 and 6.1.0
PHP 8.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions