Merge "Make api nearmatch search work same as 'go' feature"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 5 May 2015 20:41:32 +0000 (20:41 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 5 May 2015 20:41:32 +0000 (20:41 +0000)
includes/api/ApiQuerySearch.php

index c12630e..90af15a 100644 (file)
@@ -92,7 +92,9 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                } 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