Add 'whatlinkshere-filters'
[lhc/web/wiklou.git] / maintenance / rebuildtextindex.php
1 <?php
2 /**
3 * Rebuild search index table from scratch. This takes several
4 * hours, depending on the database size and server configuration.
5 *
6 * This is only for MySQL (see bug 9905). For postgres we can probably
7 * use SearchPostgres::update($pageid);
8 *
9 * @todo document
10 * @addtogroup Maintenance
11 */
12
13 /** */
14 require_once( "commandLine.inc" );
15 require_once( "rebuildtextindex.inc" );
16
17 $database = wfGetDB( DB_MASTER );
18 if( !$database instanceof DatabaseMysql ) {
19 print "This script is only for MySQL.\n";
20 exit();
21 }
22
23 $wgTitle = Title::newFromText( "Rebuild text index script" );
24
25 dropTextIndex( $database );
26 rebuildTextIndex( $database );
27 createTextIndex( $database );
28
29 print "Done.\n";
30 exit();
31
32