summaryrefslogtreecommitdiff
path: root/maintenance/rebuildtextindex.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/rebuildtextindex.php')
-rw-r--r--maintenance/rebuildtextindex.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php
index 6f31cbb6..47d297a9 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 );
@@ -21,4 +29,4 @@ createTextIndex( $database );
print "Done.\n";
exit();
-?>
+