X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecials%2FSpecialSearch.php;h=6606c7f883b15e89eeb53ce5c69a8456fd0f87a4;hb=ee734d0d3c7533bd9a690dbd71f5151da55c32ad;hp=af2dc94b3278cce476ad4a53afb48be7fa73053f;hpb=94946c7e05383ab700648acca1a3101529ec9ed3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index af2dc94b32..6606c7f883 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -216,6 +216,7 @@ class SpecialSearch extends SpecialPage { global $wgContLang; $search = $this->getSearchEngine(); + $search->setFeatureData( 'rewrite', $this->runSuggestion ); $search->setLimitOffset( $this->limit, $this->offset ); $search->setNamespaces( $this->namespaces ); $search->prefix = $this->mPrefix; @@ -272,12 +273,8 @@ class SpecialSearch extends SpecialPage { // did you mean... suggestions $didYouMeanHtml = ''; if ( $showSuggestion && $textMatches && !$textStatus ) { - if ( $this->shouldRunSuggestedQuery( $textMatches ) ) { - $newMatches = $search->searchText( $textMatches->getSuggestionQuery() ); - if ( $newMatches instanceof SearchResultSet && $newMatches->numRows() > 0 ) { - $didYouMeanHtml = $this->getDidYouMeanRewrittenHtml( $term, $textMatches ); - $textMatches = $newMatches; - } + if ( $textMatches->hasRewrittenQuery() ) { + $didYouMeanHtml = $this->getDidYouMeanRewrittenHtml( $term, $textMatches ); } elseif ( $textMatches->hasSuggestion() ) { $didYouMeanHtml = $this->getDidYouMeanHtml( $textMatches ); } @@ -463,7 +460,7 @@ class SpecialSearch extends SpecialPage { // Showing results for '$rewritten' // Search instead for '$orig' - $params = array( 'search' => $textMatches->getSuggestionQuery() ); + $params = array( 'search' => $textMatches->getQueryAfterRewrite() ); if ( $this->fulltext != null ) { $params['fulltext'] = $this->fulltext; } @@ -471,7 +468,7 @@ class SpecialSearch extends SpecialPage { $rewritten = Linker::linkKnown( $this->getPageTitle(), - $textMatches->getSuggestionSnippet() ?: null, + $textMatches->getQueryAfterRewriteSnippet() ?: null, array(), $stParams );