When building the result list, each link results in a database query.
The select is on the page table, so it is known, that each page exists,
but using Linker::linkKnown does not prepare the link for stubthreshold
or redirect marker.
Change-Id: I8f73d398f510f252ac8d5a0fd04ccb0feaf79cc4
return $retval;
}
+ /**
+ * Pre-fill the link cache
+ *
+ * @param DatabaseBase $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