Index: trunk/phase3/includes/search/SearchMySQL.php |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | if( $this->showRedirects ) { |
198 | 198 | return ''; |
199 | 199 | } else { |
200 | | - return 'AND page_is_redirect=0'; |
| 200 | + return 'page_is_redirect=0'; |
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | } else { |
214 | 214 | $namespaces = $this->db->makeList( $this->namespaces ); |
215 | 215 | } |
216 | | - return 'AND page_namespace IN (' . $namespaces . ')'; |
| 216 | + return 'page_namespace IN (' . $namespaces . ')'; |
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
— | — | @@ -240,8 +240,8 @@ |
241 | 241 | */ |
242 | 242 | function getQuery( $filteredTerm, $fulltext ) { |
243 | 243 | return $this->queryMain( $filteredTerm, $fulltext ) . ' ' . |
244 | | - $this->queryRedirect() . ' ' . |
245 | | - $this->queryNamespaces() . ' ' . |
| 244 | + 'AND ' . $this->queryRedirect() . ' ' . |
| 245 | + 'AND ' . $this->queryNamespaces() . ' ' . |
246 | 246 | $this->queryRanking( $filteredTerm, $fulltext ) . ' ' . |
247 | 247 | $this->queryLimit(); |
248 | 248 | } |
— | — | @@ -276,13 +276,15 @@ |
277 | 277 | |
278 | 278 | function getCountQuery( $filteredTerm, $fulltext ) { |
279 | 279 | $match = $this->parseQuery( $filteredTerm, $fulltext ); |
280 | | - $page = $this->db->tableName( 'page' ); |
281 | | - $searchindex = $this->db->tableName( 'searchindex' ); |
282 | | - return "SELECT COUNT(*) AS c " . |
283 | | - "FROM $page,$searchindex " . |
284 | | - 'WHERE page_id=si_page AND ' . $match . |
285 | | - $this->queryRedirect() . ' ' . |
286 | | - $this->queryNamespaces(); |
| 280 | + |
| 281 | + return $this->db->selectSQLText( array( 'page', 'searchindex' ), |
| 282 | + 'COUNT(*) AS c', |
| 283 | + array( |
| 284 | + 'page_id=si_page', |
| 285 | + $match, |
| 286 | + $this->queryRedirect(), |
| 287 | + $this->queryNamespaces() |
| 288 | + ) ); |
287 | 289 | } |
288 | 290 | |
289 | 291 | /** |