Page MenuHomePhabricator

Searching for "File:" shows no results, yet a result count is shown
Closed, ResolvedPublic

Description

On https://commons.wikimedia.org/w/index.php?search=File%3A&title=Special%3ASearch&fulltext=1, "Results 1 - 20 of 23,135,741" is shown, though the 20 results that are supposed to be on the page are not there.

It turns out that SpecialSearch does the following check:

$filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
if ( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
	// Empty query -- straight view of search form
	return;
}

The $filePrefix part of this was added in https://www.mediawiki.org/wiki/Special:Code/MediaWiki/44252, though it's unclear why. However, it is not present in the SearchEngine classes, and SpecialSearch performs the "search" even when it is not going to show the results.

Event Timeline

PleaseStand raised the priority of this task from to Needs Triage.
PleaseStand updated the task description. (Show Details)
PleaseStand added a project: MediaWiki-Search.
PleaseStand changed Security from none to None.
PleaseStand added subscribers: PleaseStand, demon, aaron.
TheDJ claimed this task.
TheDJ subscribed.

This no longer shows a count