MediaWiki master
SearchExactMatchRescorer Class Reference

An utility class to rescore search results by looking for an exact match in the db and add the page found to the first position. More...

Public Member Functions

 getReplacedRedirect ()
 Redirect initially returned by the search engine that got replaced by a better match:
 
 rescore ( $search, $namespaces, $srchres, $limit)
 Default search backend does proper prefix searching, but custom backends may sort based on other algorithms that may cause the exact title match to not be in the results or be lower down the list.
 

Detailed Description

An utility class to rescore search results by looking for an exact match in the db and add the page found to the first position.

NOTE: extracted from TitlePrefixSearch

Definition at line 34 of file SearchExactMatchRescorer.php.

Member Function Documentation

◆ getReplacedRedirect()

SearchExactMatchRescorer::getReplacedRedirect ( )

Redirect initially returned by the search engine that got replaced by a better match:

  • exact match to a redirect to the same page
  • exact match to the target page
    Returns
    string|null the replaced redirect or null if nothing was replaced

Definition at line 113 of file SearchExactMatchRescorer.php.

◆ rescore()

SearchExactMatchRescorer::rescore ( $search,
$namespaces,
$srchres,
$limit )

Default search backend does proper prefix searching, but custom backends may sort based on other algorithms that may cause the exact title match to not be in the results or be lower down the list.

Parameters
string$searchthe query
int[]$namespaces
string[]$srchresresults
int$limitthe max number of results to return
Returns
string[] munged results

Definition at line 50 of file SearchExactMatchRescorer.php.

References NS_MAIN.


The documentation for this class was generated from the following file: