From 5280fbe9490b637a7230683f55bb7bec63bb2eb9 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Wed, 13 Jan 2010 15:29:24 +0000 Subject: [PATCH] Renamed $wgSearchMySQLTotalHits to $wgCountTotalSearchHits, since such functionality also exists in SearchSqlite. No migration needed, as it was added in 1.16. --- includes/DefaultSettings.php | 5 +++-- includes/search/SearchMySQL.php | 4 ++-- includes/search/SearchSqlite.php | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0b710e5d37..50c8601353 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2017,15 +2017,16 @@ $wgSearchHighlightBoundaries = version_compare("5.1", PHP_VERSION, "<")? '[\p{Z} : '[ ,.;:!?~!@#$%\^&*\(\)+=\-\\|\[\]"\'<>\n\r\/{}]'; // PHP 5.0 workaround /** - * Set to true to have the default MySQL search engine count total + * Set to true to have the search engine count total * search matches to present in the Special:Search UI. + * Not supported by every search engine shipped with MW. * * This could however be slow on larger wikis, and is pretty flaky * with the current title vs content split. Recommend avoiding until * that's been worked out cleanly; but this may aid in testing the * search UI and API to confirm that the result count works. */ -$wgSearchMySQLTotalHits = false; +$wgCountTotalSearchHits = false; /** * Template for OpenSearch suggestions, defaults to API action=opensearch diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index 5eaf972cdb..ab55caf9b5 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -162,13 +162,13 @@ class SearchMySQL extends SearchEngine { } protected function searchInternal( $term, $fulltext ) { - global $wgSearchMySQLTotalHits; + global $wgCountTotalSearchHits; $filteredTerm = $this->filter( $term ); $resultSet = $this->db->query( $this->getQuery( $filteredTerm, $fulltext ) ); $total = null; - if( $wgSearchMySQLTotalHits ) { + if( $wgCountTotalSearchHits ) { $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) ); $row = $totalResult->fetchObject(); if( $row ) { diff --git a/includes/search/SearchSqlite.php b/includes/search/SearchSqlite.php index b5f45e1ba2..be5d10ac10 100644 --- a/includes/search/SearchSqlite.php +++ b/includes/search/SearchSqlite.php @@ -174,7 +174,7 @@ class SearchSqlite extends SearchEngine { } protected function searchInternal( $term, $fulltext ) { - global $wgSearchMySQLTotalHits, $wgContLang; + global $wgCountTotalSearchHits, $wgContLang; if ( !$this->fulltextSearchSupported() ) { return null; @@ -184,7 +184,7 @@ class SearchSqlite extends SearchEngine { $resultSet = $this->db->query( $this->getQuery( $filteredTerm, $fulltext ) ); $total = null; - if( $wgSearchMySQLTotalHits ) { + if( $wgCountTotalSearchHits ) { $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) ); $row = $totalResult->fetchObject(); if( $row ) { -- 2.20.1