Merge "Include additional analytics in Special:Search"
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 28769ec..91e84e4 100644 (file)
@@ -416,10 +416,7 @@ class SpecialSearch extends SpecialPage {
                        return false;
                }
 
-               // Generate a random number between 0 and 1. If the
-               // number is less than the desired percentages run it.
-               $rand = rand( 0, getrandmax() ) / getrandmax();
-               return $this->getConfig()->get( 'SearchRunSuggestedQueryPercent' ) > $rand;
+               return $this->getConfig()->get( 'SearchRunSuggestedQuery' );
        }
 
        /**
@@ -437,7 +434,7 @@ class SpecialSearch extends SpecialPage {
                $suggest = Linker::linkKnown(
                        $this->getPageTitle(),
                        $textMatches->getSuggestionSnippet() ?: null,
-                       array(),
+                       array( 'id' => 'mw-search-DYM-suggestion' ),
                        $stParams
                );
 
@@ -471,7 +468,7 @@ class SpecialSearch extends SpecialPage {
                $rewritten = Linker::linkKnown(
                        $this->getPageTitle(),
                        $textMatches->getQueryAfterRewriteSnippet() ?: null,
-                       array(),
+                       array( 'id' => 'mw-search-DYM-rewritten' ),
                        $stParams
                );
 
@@ -480,7 +477,7 @@ class SpecialSearch extends SpecialPage {
                $original = Linker::linkKnown(
                        $this->getPageTitle(),
                        htmlspecialchars( $term ),
-                       array(),
+                       array( 'id' => 'mw-search-DYM-original' ),
                        $stParams
                );
 
@@ -696,9 +693,9 @@ class SpecialSearch extends SpecialPage {
                        array( 'data-serp-pos' => $position ) // HTML attributes
                );
 
-               //If page content is not readable, just return the title.
-               //This is not quite safe, but better than showing excerpts from non-readable pages
-               //Note that hiding the entry entirely would screw up paging.
+               // If page content is not readable, just return the title.
+               // This is not quite safe, but better than showing excerpts from non-readable pages
+               // Note that hiding the entry entirely would screw up paging.
                if ( !$title->userCan( 'read', $this->getUser() ) ) {
                        return "<li>{$link}</li>\n";
                }