From 1623b226293e5e7173f1d4b40852693f2c7016a6 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 14 May 2007 20:24:10 +0000 Subject: [PATCH] This is only for MySQL. --- maintenance/rebuildtextindex.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index 6f31cbb6b5..6fed4aa967 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -3,6 +3,9 @@ * Rebuild search index table from scratch. This takes several * hours, depending on the database size and server configuration. * + * This is only for MySQL (see bug 9905). For postgres we can probably + * use SearchPostgres::update($pageid); + * * @todo document * @addtogroup Maintenance */ @@ -10,9 +13,14 @@ /** */ require_once( "commandLine.inc" ); require_once( "rebuildtextindex.inc" ); -$wgTitle = Title::newFromText( "Rebuild text index script" ); -$database = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); +$database = wfGetDB( DB_MASTER ); +if( !$database instanceof DatabaseMysql ) { + print "This script is only for MySQL.\n"; + exit(); +} + +$wgTitle = Title::newFromText( "Rebuild text index script" ); dropTextIndex( $database ); rebuildTextIndex( $database ); -- 2.20.1