X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchEngine.php;h=b263fb39e964ccbedd7f4ac128f1dc14232e62cb;hb=cd3567e88511886861373d0bb1ff5523ec9ee818;hp=10e56bfa2fa690c29113962105fac2626bc02089;hpb=f9d7d3b8561dab3ddfd8798a77a5b72e03ac8c2b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 10e56bfa2f..b263fb39e9 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -54,7 +54,7 @@ class SearchEngine { /** * Perform a full text search query and return a result set. - * If title searches are not supported or disabled, return null. + * If full text searches are not supported or disabled, return null. * STUB * * @param string $term Raw search term @@ -708,10 +708,6 @@ class SearchEngine { * @return SearchSuggestionSet */ protected function processCompletionResults( $search, SearchSuggestionSet $suggestions ) { - if ( $suggestions->getSize() == 0 ) { - // If we don't have anything, don't bother - return $suggestions; - } $search = trim( $search ); // preload the titles with LinkBatch $titles = $suggestions->map( function( SearchSuggestion $sugg ) { @@ -726,6 +722,10 @@ class SearchEngine { } ); // Rescore results with an exact title match + // NOTE: in some cases like cross-namespace redirects + // (frequently used as shortcuts e.g. WP:WP on huwiki) some + // backends like Cirrus will return no results. We should still + // try an exact title match to workaround this limitation $rescorer = new SearchExactMatchRescorer(); $rescoredResults = $rescorer->rescore( $search, $this->namespaces, $results, $this->limit );