* Parse the user's query and transform it into an SQL fragment which will
* become part of a WHERE clause
*
+ * @param string $filteredText
+ * @param bool $fulltext
* @return string
*/
function parseQuery( $filteredText, $fulltext ) {
}
protected function searchInternal( $term, $fulltext ) {
- global $wgCountTotalSearchHits, $wgContLang;
+ global $wgContLang;
if ( !$this->fulltextSearchSupported() ) {
return null;
$resultSet = $this->db->query( $this->getQuery( $filteredTerm, $fulltext ) );
$total = null;
- if ( $wgCountTotalSearchHits ) {
- $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) );
- $row = $totalResult->fetchObject();
- if ( $row ) {
- $total = intval( $row->c );
- }
- $totalResult->free();
+ $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) );
+ $row = $totalResult->fetchObject();
+ if ( $row ) {
+ $total = intval( $row->c );
}
+ $totalResult->free();
return new SqlSearchResultSet( $resultSet, $this->searchTerms, $total );
}