Maintenance script "rebuild­Fulltext­Search­Table.php"

Allows to rebuild the full text search data table
Further Information
Provided by: Semantic MediaWiki
Added: 2.5.0
Removed: still in use
Location (path): ./extensions/SemanticMediaWiki/maintenance/
Table of Contents

The "rebuildFulltextSearchTable.php" maintenance script rebuilds the database table used for the full-text search feature. The maintenance script was introduced in Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x.1 and currently only works if configuration parameter $smwgDefaultStoreSets the storage backend to be used for the semantic data is set to SMWSQLStore3 (= default setting) and here only for MySQL/MariaDB1 and SQLite2, i.e. PostgreSQL3 and SPARQL stores are currently not supported. Note that this script enforces an five second countdown period prior to its actual execution.

It is recommended to run this script in daily intervals as part of the general wiki maintenance.


php rebuildFulltextSearchTable.php [--v|--quick|--optimize|--report-runtime|--with-maintenance-log]
This only shows the script specific parameters.


Generic parameters[edit]

Parameter Description
--help (-h) Display this help message
--quiet (-q) Whether to supress non-error output
--conf: Location of "LocalSettings.php", if not default
--wiki For specifying the wiki ID
--globals Output globals at the end of processing for debugging
--memory-limit Set a specific memory limit for the script, "max" for no limit or "default" to avoid changing it
--server: The protocol and server name to use in URLs, e.g. This is sometimes necessary because server name detection may fail in command line scripts.

Script dependant parameters[edit]

Parameter Description
--dbuser The DB user to use for this script
--dbpass The password to use for this script

Script specific parameters[edit]

Parameter Description
--v Be verbose about the progress4
--quick Skip the five second countdown sequence4
--optimize Run possible table optimization56
--report-runtime Return memory usage and runtime of the respective script execution1
--with-maintenance-log Add a log entry to "Special:Logs" on the wiki and report the script's runtime7

NoteNote:  If you are using this parameter make sure that MediaWiki's configuration parameter $wgMaxNameChars ( is set to a value not lower than "32".8 Otherwise an exception will be issued informing about the minimum value for this setting ("32" or higher is recommended).9

If Semantic MediaWiki is not installed in its standard path then the "MW_INSTALL_PATH" environment variable must be set. See README in the maintenance directory.



  1. a b c  Semantic MediaWiki: GitHub pull request gh:smw:1481
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:1801
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:1956
  4. a b  Semantic MediaWiki: GitHub issue gh:smw:1763
  5. ^  Semantic MediaWiki: GitHub pull request gh:smw:2120
  6. ^  Optimizing InnoDB Full-Text Indexes notes "Running OPTIMIZE TABLE on a table with a full-text index rebuilds the full-text index, removing deleted Document IDs and consolidating multiple entries for the same word, where possible."
  7. ^  Semantic MediaWiki: GitHub issue gh:smw:1764
  8. ^  Semantic MediaWiki: GitHub issue gh:smw:1983
  9. ^  Semantic MediaWiki: GitHub pull request gh:smw:1985