Manybubbles has uploaded a new change for review.
https://gerrit.wikimedia.org/r/78237
Change subject: Use the archive table to find deletes.
......................................................................
Use the archive table to find deletes.
Closes bug 52612 by successfully returning page ids for deleted pages
again.
Change-Id: If4f484297b2532f42749cca47ee8383af06f5cf5
---
M forceSearchIndex.php
1 file changed, 10 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/37/78237/1
diff --git a/forceSearchIndex.php b/forceSearchIndex.php
index ba1dbe9..0105930 100644
--- a/forceSearchIndex.php
+++ b/forceSearchIndex.php
@@ -216,32 +216,27 @@
private function findDeletes( $minUpdate, $minNamespace, $minTitle,
$maxUpdate ) {
wfProfileIn( __METHOD__ );
$dbr = $this->getDB( DB_SLAVE );
- $logType = $dbr->addQuotes( 'delete' );
- $logAction = $dbr->addQuotes( 'delete' );
$minUpdate = $dbr->addQuotes( $dbr->timestamp( $minUpdate ) );
$minNamespace = $dbr->addQuotes( $minNamespace );
$minTitle = $dbr->addQuotes( $minTitle );
$maxUpdate = $dbr->addQuotes( $dbr->timestamp( $maxUpdate ) );
$res = $dbr->select(
- 'logging',
- array( 'log_timestamp', 'log_namespace', 'log_title',
'log_page' ),
- "log_type = $logType"
- . " AND log_action = $logAction"
- . ' AND log_page != 0'
- . " AND ( ( $minUpdate = log_timestamp AND
$minNamespace < log_namespace AND $minTitle < log_title )"
- . " OR $minUpdate < log_timestamp )"
- . " AND log_timestamp <= $maxUpdate",
+ 'archive',
+ array( 'ar_timestamp', 'ar_namespace', 'ar_title',
'ar_page_id' ),
+ "( ( $minUpdate = ar_timestamp AND
$minNamespace < ar_namespace AND $minTitle < ar_title )"
+ . " OR $minUpdate < ar_timestamp )"
+ . " AND ar_timestamp <= $maxUpdate",
__METHOD__,
- array( 'ORDER BY' => 'log_timestamp, log_namespace,
log_title',
+ array( 'ORDER BY' => 'ar_timestamp, ar_namespace,
ar_title',
'LIMIT' => $this->mBatchSize )
);
$result = array();
foreach ( $res as $row ) {
$result[] = array(
- 'timestamp' => new MWTimestamp(
$row->log_timestamp ), // This feels funky
- 'namespace' => $row->log_namespace,
- 'title' => $row->log_title,
- 'page' => $row->log_page
+ 'timestamp' => new MWTimestamp(
$row->ar_timestamp ),
+ 'namespace' => $row->ar_namespace,
+ 'title' => $row->ar_title,
+ 'page' => $row->ar_page_id,
);
}
wfProfileOut( __METHOD__ );
--
To view, visit https://gerrit.wikimedia.org/r/78237
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If4f484297b2532f42749cca47ee8383af06f5cf5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits