Index: trunk/phase3/includes/search/SearchMySQL.php |
— | — | @@ -290,14 +290,18 @@ |
291 | 291 | function getCountQuery( $filteredTerm, $fulltext ) { |
292 | 292 | $match = $this->parseQuery( $filteredTerm, $fulltext ); |
293 | 293 | |
| 294 | + $redir = $this->queryRedirect(); |
| 295 | + $namespaces = $this->queryNamespaces(); |
| 296 | + $conditions = array( 'page_id=si_page', $match ); |
| 297 | + if ( $redir !== '' ) { |
| 298 | + $conditions[] = $redir; |
| 299 | + } |
| 300 | + if ( $namespaces !== '' ) { |
| 301 | + $conditions[] = $namespaces; |
| 302 | + } |
294 | 303 | return $this->db->selectSQLText( array( 'page', 'searchindex' ), |
295 | 304 | 'COUNT(*) AS c', |
296 | | - array( |
297 | | - 'page_id=si_page', |
298 | | - $match, |
299 | | - $this->queryRedirect(), |
300 | | - $this->queryNamespaces() |
301 | | - ), |
| 305 | + $conditions, |
302 | 306 | __METHOD__ |
303 | 307 | ); |
304 | 308 | } |