Deciding how to behave randomly is useful for testing, yet misleading
for general usage. Now that testing is over, make it a boolean switch.
Change-Id: I3e4d02aa57c853c20152c9071c444e09da57fb35
page. During the deprecation period, the styles will only be loaded on pages
which contain 'mw-ui-button' in their HTML. Starting in 1.28, the styles will
only be loaded if explicitly required.
+* If search returns zero results and current search engine has a "did you mean"
+ suggestion, results for suggestion will be shown. Can be disabled by setting
+ $wgSearchRunSuggestedQuery to false.
==== External libraries ====
* Update es5-shim from v4.0.0 to v4.1.5.
);
/**
- * Controls the percentage of zero-result search queries with suggestions that
- * run the suggestion automatically. Must be a number between 0 and 1. This
- * can be lowered to reduce query volume at the expense of result quality.
+ * Controls whether zero-result search queries with suggestions should display results for
+ * these suggestions.
*
- * @var float
+ * @var bool
* @since 1.26
*/
-$wgSearchRunSuggestedQueryPercent = 1;
+$wgSearchRunSuggestedQuery = true;
/**
* For really cool vim folding this needs to be at the end:
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' );
}
/**