X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Frebuildtextindex.php;h=f06e62b284825d02907705e29edc76a2c97cca1f;hb=a38af7ba26579bb3004f673e44d39710887763aa;hp=5971d5e9f7fb4e955d94441a78432bf92b84b0fe;hpb=46eddc4b82404a58beb6de172371e0c108f4f482;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index 5971d5e9f7..2e4cc88058 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -56,17 +56,17 @@ class RebuildTextIndex extends Maintenance { // Shouldn't be needed for Postgres $this->db = $this->getDB( DB_MASTER ); if ( $this->db->getType() == 'postgres' ) { - $this->error( "This script is not needed when using Postgres.\n", true ); + $this->fatalError( "This script is not needed when using Postgres.\n" ); } if ( $this->db->getType() == 'sqlite' ) { if ( !DatabaseSqlite::getFulltextSearchModule() ) { - $this->error( "Your version of SQLite module for PHP doesn't " - . "support full-text search (FTS3).\n", true ); + $this->fatalError( "Your version of SQLite module for PHP doesn't " + . "support full-text search (FTS3).\n" ); } if ( !$this->db->checkForEnabledSearch() ) { - $this->error( "Your database schema is not configured for " - . "full-text search support. Run update.php.\n", true ); + $this->fatalError( "Your database schema is not configured for " + . "full-text search support. Run update.php.\n" ); } } @@ -93,7 +93,7 @@ class RebuildTextIndex extends Maintenance { $this->output( "Rebuilding index fields for {$count} pages...\n" ); $n = 0; - $revQuery = Revision::getQueryInfo( [ 'page', 'text' ] ); + $revQuery = Revision::getQueryInfo( [ 'page' ] ); while ( $n < $count ) { if ( $n ) { @@ -101,9 +101,13 @@ class RebuildTextIndex extends Maintenance { } $end = $n + self::RTI_CHUNK_SIZE - 1; - $res = $this->db->select( $revQuery['tables'], $revQuery['fields'], - [ "page_id BETWEEN $n AND $end", 'page_latest = rev_id', 'rev_text_id = old_id' ], - __METHOD__ + $res = $this->db->select( + $revQuery['tables'], + $revQuery['fields'], + [ "page_id BETWEEN $n AND $end", 'page_latest = rev_id' ], + __METHOD__, + [], + $revQuery['joins'] ); foreach ( $res as $s ) { @@ -157,5 +161,5 @@ class RebuildTextIndex extends Maintenance { } } -$maintClass = "RebuildTextIndex"; +$maintClass = RebuildTextIndex::class; require_once RUN_MAINTENANCE_IF_MAIN;