* @return MySQLSearchResultSet
*/
function searchText( $term ) {
+ return $this->searchInternal( $term, true );
+ }
+
+ /**
+ * Perform a title-only search query and return a result set.
+ *
+ * @param $term String: raw search term
+ * @return MySQLSearchResultSet
+ */
+ function searchTitle( $term ) {
+ return $this->searchInternal( $term, false );
+ }
+
+ protected function searchInternal( $term, $fulltext ) {
global $wgSearchMySQLTotalHits;
$filteredTerm = $this->filter( $term );
- $resultSet = $this->db->query( $this->getQuery( $filteredTerm, true ) );
+ $resultSet = $this->db->query( $this->getQuery( $filteredTerm, $fulltext ) );
$total = null;
if( $wgSearchMySQLTotalHits ) {
- $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, true ) );
+ $totalResult = $this->db->query( $this->getCountQuery( $filteredTerm, $fulltext ) );
$row = $totalResult->fetchObject();
if( $row ) {
$total = $row->c;
return new MySQLSearchResultSet( $resultSet, $this->searchTerms, $total );
}
- /**
- * Perform a title-only search query and return a result set.
- *
- * @param $term String: raw search term
- * @return MySQLSearchResultSet
- */
- function searchTitle( $term ) {
- $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) );
- return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
- }
-
/**
* Return a partial WHERE clause to exclude redirects, if so set