if( $this->showRedirects ) {
return '';
} else {
- return 'AND page_is_redirect=0';
+ return 'page_is_redirect=0';
}
}
} else {
$namespaces = $this->db->makeList( $this->namespaces );
}
- return 'AND page_namespace IN (' . $namespaces . ')';
+ return 'page_namespace IN (' . $namespaces . ')';
}
/**
*/
function getQuery( $filteredTerm, $fulltext ) {
return $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
- $this->queryRedirect() . ' ' .
- $this->queryNamespaces() . ' ' .
+ 'AND ' . $this->queryRedirect() . ' ' .
+ 'AND ' . $this->queryNamespaces() . ' ' .
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' .
$this->queryLimit();
}
function getCountQuery( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
- $page = $this->db->tableName( 'page' );
- $searchindex = $this->db->tableName( 'searchindex' );
- return "SELECT COUNT(*) AS c " .
- "FROM $page,$searchindex " .
- 'WHERE page_id=si_page AND ' . $match .
- $this->queryRedirect() . ' ' .
- $this->queryNamespaces();
+
+ return $this->db->selectSQLText( array( 'page', 'searchindex' ),
+ 'COUNT(*) AS c',
+ array(
+ 'page_id=si_page',
+ $match,
+ $this->queryRedirect(),
+ $this->queryNamespaces()
+ ) );
}
/**