http://www.mediawiki.org/wiki/Special:Code/MediaWiki/58274
Revision: 58274 Author: maxsem Date: 2009-10-28 19:05:17 +0000 (Wed, 28 Oct 2009) Log Message: ----------- Comments and refactoring Modified Paths: -------------- branches/sqlite/includes/search/SearchSqlite.php Modified: branches/sqlite/includes/search/SearchSqlite.php =================================================================== --- branches/sqlite/includes/search/SearchSqlite.php 2009-10-28 19:02:27 UTC (rev 58273) +++ branches/sqlite/includes/search/SearchSqlite.php 2009-10-28 19:05:17 UTC (rev 58274) @@ -28,7 +28,10 @@ class SearchSqlite extends SearchEngine { var $strictMatching = true; - /** @todo document */ + /** + * Creates an instance of this class + * @param $db DatabaseSqlite: database object + */ function __construct( $db ) { $this->db = $db; } @@ -208,11 +211,12 @@ } /** - * Return a LIMIT clause to limit results on the query. + * Returns a query with limit for number of results set. + * @param $sql String: * @return String */ - function queryLimit() { - return $this->db->limitResult( '', $this->limit, $this->offset ); + function limitResult( $sql ) { + return $this->db->limitResult( $sql, $this->limit, $this->offset ); } /** @@ -231,11 +235,12 @@ * @param $fulltext Boolean */ function getQuery( $filteredTerm, $fulltext ) { - return $this->queryMain( $filteredTerm, $fulltext ) . ' ' . + return $this->limitResult( + $this->queryMain( $filteredTerm, $fulltext ) . ' ' . $this->queryRedirect() . ' ' . $this->queryNamespaces() . ' ' . - $this->queryRanking( $filteredTerm, $fulltext ) . ' ' . - $this->queryLimit(); + $this->queryRanking( $filteredTerm, $fulltext ) + ); } /** @@ -306,8 +311,7 @@ $dbw->update( 'searchindex', array( 'si_title' => $title ), array( 'si_page' => $id ), - __METHOD__, - array( $dbw->lowPriorityOption() ) ); + __METHOD__ ); } } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs