3 # Rebuild the fulltext search indexes. This may take a while
4 # depending on the database size and server configuration.
7 include_once( "../LocalSettings.php" );
8 include_once( "$IP/Setup.php" );
9 include_once( "$IP/SearchUpdate.php" );
12 $wgDBuser = "wikiadmin";
13 $wgDBpassword = $wgDBadminpassword;
15 # May run faster if you drop the index; but will break attempts to search
16 # while it's running if you're online.
17 #echo "Dropping index...\n";
18 ##$sql = "ALTER TABLE searchindex DROP INDEX si_title, DROP INDEX si_text";
19 #$res = wfQuery($sql);
21 $sql = "SELECT COUNT(*) AS count FROM cur";
23 $s = wfFetchObject($res);
24 echo "Rebuilding index fields for {$s->count} pages...\n";
27 $sql = "SELECT cur_id, cur_namespace, cur_title, cur_text FROM cur";
29 while( $s = wfFetchObject($res)) {
30 $u = new SearchUpdate( $s->cur_id
, $s->cur_title
, $s->cur_text
);
32 if ( ( (++
$n) %
500) == 0) {
38 #echo "Rebuild the index...\n";
39 ##$sql = "ALTER TABLE searchindex ADD FULLTEXT si_title (si_title),
40 ## ADD FULLTEXT si_text (si_text)";
41 #$res = wfQuery($sql);