From: nomoa Date: Tue, 12 Jan 2016 01:22:25 +0000 (-0800) Subject: De-duplicate near match query terms when generating variants X-Git-Tag: 1.31.0-rc.0~8368^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=33e5c11e857cb051625a5654867bb6d427b7707d;p=lhc%2Fweb%2Fwiklou.git De-duplicate near match query terms when generating variants zhwiki generates 9 variants: we should not run these queries if the term is unchanged. Change-Id: If23d19761dea33bf4bdcf6495becc8e983915fde --- diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index e5ed23f5a6..3c8d56ea48 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -164,10 +164,10 @@ class SearchEngine { $allSearchTerms = array( $searchterm ); if ( $wgContLang->hasVariants() ) { - $allSearchTerms = array_merge( + $allSearchTerms = array_unique( array_merge( $allSearchTerms, $wgContLang->autoConvertToAllVariants( $searchterm ) - ); + ) ); } $titleResult = null;