Help:Configuration parameter "$smwgFulltextSearchTableOptions"
|Description||Sets the full-text search table options to use during installation or update|
|Default setting||See below|
|First version supported||2.5.0|
|Last version supported||still available|
|Keyword||Full-text search · data store|
$smwgFulltextSearchTableOptions is a configuration parameter that sets the full-text search table options to use during installation or update. It is specific to a relational data store and currently supports MySQL/MariaDB1 and SQLite2 while PostgreSQL34 is currently not supported. The setting was introduced in Semantic MediaWiki 2.5.0 and is similar to MediaWiki's
$wgDBTableOptions configuration parameter.1
$GLOBALS['smwgFulltextSearchTableOptions'] = array( 'mysql' => array( 'ENGINE=MyISAM, DEFAULT CHARSET=utf8' ), 'sqlite' => array( 'FTS4' ) );
This means that by default either the storage engine "MyISAM" with character encoding "UTF8" for MySQL/MariaDB or "FTS4" for SQLite.
Changing the default setting
- The settings to this configuration parameter directly influence how the table for use with the full-text search is created. Therefore it should only be changed with caution.
- The "setupStore.php" maintenance script followed by the "rebuildFulltextSearchTable.php" maintenance script have to be run after changing the setting of this configuration parameter.
To modify this configuration setting, add one of the following lines to your "LocalSettings.php" file after the
- Extending the option description (MySQL 5.7+)
$smwgFulltextSearchTableOptions = array( 'mysql' => array( 'ENGINE=MyISAM, DEFAULT CHARSET=utf8', 'WITH PARSER ngram' ) );
- Specify extra arguments for the storage engine (SQLite 3.7.4+)
$smwgFulltextSearchTableOptions = array( 'sqlite' => array( 'FTS4', 'tokenize=porter' ) );
Full-text search support by database management systems
According to sources full-text search support is available by:
- MySQL version 5.6 or later with only "MyISAM" and "InnoDB" storage engines
- MariaDB only with "MyISAM" and "Aria" storage engines, from MariaDB 10.0.5 also with the "InnoDB" storage engine and and from MariaDB 10.0.15 with the "Mroonga" storage engine
- SQLite "FTS3" has been available since version 3.5.0, "FTS4" was added with version 3.7.4, and "FTS5" is available with version 3.9.0
- Help page on full-text search
- Semantic MediaWiki: GitHub pull request #1481
- Semantic MediaWiki: GitHub pull request #1801
- Semantic MediaWiki: GitHub pull request #1956 notes that "... any interested developer who is eager to help with implementing a PostgreSQL solution ..."
- Postgres is not supported due to a different index schema (e.g.
to_tsquery) but users interested to make it available are encouraged to have a look at the
MySQLValueMatchConditionBuilderon how to create a Postgres specific implementation.