Made prepareContentForEdit() use the stash cache by default
[lhc/web/wiklou.git] / includes / search / SearchMySQL.php
index 8ff2640..78eba2d 100644 (file)
@@ -174,8 +174,6 @@ class SearchMySQL extends SearchDatabase {
        }
 
        protected function searchInternal( $term, $fulltext ) {
-               global $wgCountTotalSearchHits;
-
                // This seems out of place, why is this called with empty term?
                if ( trim( $term ) === '' ) {
                        return null;
@@ -189,19 +187,17 @@ class SearchMySQL extends SearchDatabase {
                );
 
                $total = null;
-               if ( $wgCountTotalSearchHits ) {
-                       $query = $this->getCountQuery( $filteredTerm, $fulltext );
-                       $totalResult = $this->db->select(
-                               $query['tables'], $query['fields'], $query['conds'],
-                               __METHOD__, $query['options'], $query['joins']
-                       );
-
-                       $row = $totalResult->fetchObject();
-                       if ( $row ) {
-                               $total = intval( $row->c );
-                       }
-                       $totalResult->free();
+               $query = $this->getCountQuery( $filteredTerm, $fulltext );
+               $totalResult = $this->db->select(
+                       $query['tables'], $query['fields'], $query['conds'],
+                       __METHOD__, $query['options'], $query['joins']
+               );
+
+               $row = $totalResult->fetchObject();
+               if ( $row ) {
+                       $total = intval( $row->c );
                }
+               $totalResult->free();
 
                return new SqlSearchResultSet( $resultSet, $this->searchTerms, $total );
        }
@@ -307,6 +303,8 @@ class SearchMySQL extends SearchDatabase {
 
        /**
         * @since 1.18 (changed)
+        * @param string $filteredTerm
+        * @param bool $fulltext
         * @return array
         */
        function getCountQuery( $filteredTerm, $fulltext ) {
@@ -378,6 +376,7 @@ class SearchMySQL extends SearchDatabase {
        /**
         * Converts some characters for MySQL's indexing to grok it correctly,
         * and pads short words to overcome limitations.
+        * @param string $string
         * @return mixed|string
         */
        function normalizeText( $string ) {
@@ -426,6 +425,7 @@ class SearchMySQL extends SearchDatabase {
         * Armor a case-folded UTF-8 string to get through MySQL's
         * fulltext search without being mucked up by funny charset
         * settings or anything else of the sort.
+        * @param array $matches
         * @return string
         */
        protected function stripForSearchCallback( $matches ) {