Merge "search: did you mean should always go to SERP"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 23 Jun 2016 15:22:24 +0000 (15:22 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 23 Jun 2016 15:22:25 +0000 (15:22 +0000)
includes/specials/SpecialSearch.php

index 36ea983..45d2415 100644 (file)
@@ -485,7 +485,9 @@ class SpecialSearch extends SpecialPage {
        protected function getDidYouMeanHtml( SearchResultSet $textMatches ) {
                # mirror Go/Search behavior of original request ..
                $params = [ 'search' => $textMatches->getSuggestionQuery() ];
-               if ( $this->fulltext != null ) {
+               if ( $this->fulltext === null ) {
+                       $params['fulltext'] = 'Search';
+               } else {
                        $params['fulltext'] = $this->fulltext;
                }
                $stParams = array_merge( $params, $this->powerSearchOptions() );
@@ -519,7 +521,9 @@ class SpecialSearch extends SpecialPage {
                // Search instead for '$orig'
 
                $params = [ 'search' => $textMatches->getQueryAfterRewrite() ];
-               if ( $this->fulltext != null ) {
+               if ( $this->fulltext === null ) {
+                       $params['fulltext'] = 'Search';
+               } else {
                        $params['fulltext'] = $this->fulltext;
                }
                $stParams = array_merge( $params, $this->powerSearchOptions() );