Merge "API: Use message-per-value for apihelp-query+usercontribs-param-prop"
[lhc/web/wiklou.git] / includes / api / ApiQuerySearch.php
index c12630e..65fd727 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
@@ -236,7 +238,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
 
                                                // Add item to results and see whether it fits
                                                $fit = $apiResult->addValue(
-                                                       array( 'query', 'interwiki' . $this->getModuleName(), $result->getInterwikiPrefix()  ),
+                                                       array( 'query', 'interwiki' . $this->getModuleName(), $result->getInterwikiPrefix() ),
                                                        null,
                                                        $vals
                                                );
@@ -314,18 +316,19 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                        'size',
                                        'wordcount',
                                        'timestamp',
-                                       'score',
                                        'snippet',
                                        'titlesnippet',
                                        'redirecttitle',
                                        'redirectsnippet',
                                        'sectiontitle',
                                        'sectionsnippet',
-                                       'hasrelated',
                                        'isfilematch',
                                        'categorysnippet',
+                                       'score', // deprecated
+                                       'hasrelated', // deprecated
                                ),
                                ApiBase::PARAM_ISMULTI => true,
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => array(),
                        ),
                        'offset' => array(
                                ApiBase::PARAM_DFLT => 0,