The 'nearmatch' feature of the api is the same as the 'go' feature of on-wiki
search. This makes the nearmatch api feature return the same results as the user
would have gotten in 'go', bringing more parity between api and browser based
searching. Without this change asking for a nearmatch within a namespace fails.
Bug: T37719
Change-Id: I715326242b63c558572ce9bf69b70bd650c2bc95
} elseif ( $what == 'title' ) {
$matches = $search->searchTitle( $query );
} elseif ( $what == 'nearmatch' ) {
- $matches = SearchEngine::getNearMatchResultSet( $query );
+ // near matches must receive the user input as provided, otherwise
+ // the near matches within namespaces are lost.
+ $matches = SearchEngine::getNearMatchResultSet( $params['search'] );
} else {
// We default to title searches; this is a terrible legacy
// of the way we initially set up the MySQL fulltext-based