From 3d3ad9083476953db08f41048460d87813c3db85 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Mon, 13 Jun 2016 09:41:03 -0700 Subject: [PATCH] search: did you mean should always go to SERP Did you mean had an odd inconcistency, where if you came to Special:Search from autocomplete and click a did you mean link to an exact title match, you would be sent to the page rather than a results page. This seems odd and inconsistent, so always provide the 'fulltext' parameter to disable the 'go' feature. Change-Id: I8c80505053cd04b67afbe2139415fb0a44d954b4 --- includes/specials/SpecialSearch.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index b98ddda1af..a779b66e5d 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -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() ); -- 2.20.1