Index: branches/sqlite/includes/search/SearchSqlite.php |
— | — | @@ -28,7 +28,10 @@ |
29 | 29 | class SearchSqlite extends SearchEngine { |
30 | 30 | var $strictMatching = true; |
31 | 31 | |
32 | | - /** @todo document */ |
| 32 | + /** |
| 33 | + * Creates an instance of this class |
| 34 | + * @param $db DatabaseSqlite: database object |
| 35 | + */ |
33 | 36 | function __construct( $db ) { |
34 | 37 | $this->db = $db; |
35 | 38 | } |
— | — | @@ -208,11 +211,12 @@ |
209 | 212 | } |
210 | 213 | |
211 | 214 | /** |
212 | | - * Return a LIMIT clause to limit results on the query. |
| 215 | + * Returns a query with limit for number of results set. |
| 216 | + * @param $sql String: |
213 | 217 | * @return String |
214 | 218 | */ |
215 | | - function queryLimit() { |
216 | | - return $this->db->limitResult( '', $this->limit, $this->offset ); |
| 219 | + function limitResult( $sql ) { |
| 220 | + return $this->db->limitResult( $sql, $this->limit, $this->offset ); |
217 | 221 | } |
218 | 222 | |
219 | 223 | /** |
— | — | @@ -231,11 +235,12 @@ |
232 | 236 | * @param $fulltext Boolean |
233 | 237 | */ |
234 | 238 | function getQuery( $filteredTerm, $fulltext ) { |
235 | | - return $this->queryMain( $filteredTerm, $fulltext ) . ' ' . |
| 239 | + return $this->limitResult( |
| 240 | + $this->queryMain( $filteredTerm, $fulltext ) . ' ' . |
236 | 241 | $this->queryRedirect() . ' ' . |
237 | 242 | $this->queryNamespaces() . ' ' . |
238 | | - $this->queryRanking( $filteredTerm, $fulltext ) . ' ' . |
239 | | - $this->queryLimit(); |
| 243 | + $this->queryRanking( $filteredTerm, $fulltext ) |
| 244 | + ); |
240 | 245 | } |
241 | 246 | |
242 | 247 | /** |
— | — | @@ -306,8 +311,7 @@ |
307 | 312 | $dbw->update( 'searchindex', |
308 | 313 | array( 'si_title' => $title ), |
309 | 314 | array( 'si_page' => $id ), |
310 | | - __METHOD__, |
311 | | - array( $dbw->lowPriorityOption() ) ); |
| 315 | + __METHOD__ ); |
312 | 316 | } |
313 | 317 | } |
314 | 318 | |