}
protected function searchInternal( $term, $fulltext ) {
- global $wgCountTotalSearchHits;
-
// This seems out of place, why is this called with empty term?
if ( trim( $term ) === '' ) {
return null;
);
$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 );
}
/**
* @since 1.18 (changed)
+ * @param string $filteredTerm
+ * @param bool $fulltext
* @return array
*/
function getCountQuery( $filteredTerm, $fulltext ) {
/**
* 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 ) {
* 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 ) {