return $retval;
}
+ /**
+ * Pre-fill the link cache
+ *
+ * @param IDatabase $db
+ * @param ResultWrapper $res
+ */
+ function preprocessResults( $db, $res ) {
+ if ( $res->numRows() > 0 ) {
+ $linkBatch = new LinkBatch();
+
+ foreach ( $res as $row ) {
+ $linkBatch->add( $row->namespace, $row->title );
+ }
+
+ $res->seek( 0 );
+ $linkBatch->execute();
+ }
+ }
+
/**
* @param Skin $skin
* @param object $result Result row
return $this->msg( 'linksearch-line' )->rawParams( $urlLink, $pageLink )->escaped();
}
- /**
- * Override to check query validity.
- *
- * @param mixed $offset Numerical offset or false for no offset
- * @param mixed $limit Numerical limit or false for no limit
- */
- function doQuery( $offset = false, $limit = false ) {
- list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
- if ( $this->mMungedQuery === false ) {
- $this->getOutput()->addWikiMsg( 'linksearch-error' );
- } else {
- // For debugging
- // Generates invalid xhtml with patterns that contain --
- //$this->getOutput()->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
- parent::doQuery( $offset, $limit );
- }
- }
-
/**
* Override to squash the ORDER BY.
* We do a truncated index search, so the optimizer won't trust