}
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 );
}