Renamed $wgSearchMySQLTotalHits to $wgCountTotalSearchHits, since such functionality...
authorMax Semenik <maxsem@users.mediawiki.org>
Wed, 13 Jan 2010 15:29:24 +0000 (15:29 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Wed, 13 Jan 2010 15:29:24 +0000 (15:29 +0000)
includes/DefaultSettings.php
includes/search/SearchMySQL.php
includes/search/SearchSqlite.php

index 0b710e5..50c8601 100644 (file)
@@ -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
index 5eaf972..ab55caf 100644 (file)
@@ -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 ) {
index b5f45e1..be5d10a 100644 (file)
@@ -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 ) {