TitleInputWidget: Allow config to disable validation
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
index bc85c66..e8d59bc 100644 (file)
@@ -51,12 +51,11 @@ class RebuildTextIndex extends Maintenance {
 
        public function execute() {
                // Shouldn't be needed for Postgres
-               $this->db = wfGetDB( DB_MASTER );
+               $this->db = $this->getDB( DB_MASTER );
                if ( $this->db->getType() == 'postgres' ) {
                        $this->error( "This script is not needed when using Postgres.\n", true );
                }
 
-               $this->db = wfGetDB( DB_MASTER );
                if ( $this->db->getType() == 'sqlite' ) {
                        if ( !DatabaseSqlite::getFulltextSearchModule() ) {
                                $this->error( "Your version of SQLite module for PHP doesn't "
@@ -70,6 +69,7 @@ class RebuildTextIndex extends Maintenance {
 
                if ( $this->db->getType() == 'mysql' ) {
                        $this->dropMysqlTextIndex();
+                       $this->clearSearchIndex();
                        $this->populateSearchIndex();
                        $this->createMysqlTextIndex();
                } else {