$smwg­Fallback­Search­Type

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgFallbackSearchType
Description Sets the search engine to fall back to in case SMWSearch is used as custom search engine but is unable to interpret the search term as an semantic query.
Default setting
null
Software Semantic MediaWiki
Since version
Until version still available
Configuration Search · Installation
Keyword search · query


$smwgFallbackSearchType is a configuration parameter that sets the search engine to fall back to in case the "SMWSearch" feature is used as custom search engine but is unable to interpret the search term as an semantic query. The configuration parameter was introduced in Semantic MediaWiki 2.1.0Released on 19 January 2015 and compatible with MW 1.19.0 - 1.24.x.. Starting with Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x. compatibility with other search types than SearchMySQL, SearchPostgres or SearchOracle was improved.1

Default setting[edit]

$smwgFallbackSearchType = null;

This means that the the default search engine for the selected database type (e.g. SearchMySQL, SearchPostgres or SearchOracle) will be used as fallback search backend.

Changing the default setting[edit]

To modify the setting to this configuration parameter, add the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Use CirrusSearch as default fallback search backend

This means that CirrusSearch provided by extension "CirrusSearch" (MediaWiki.org) will be used as fallback search backend.


→ MediaWiki 1.35.x and later:2

use CirrusSearch\CirrusSearch;

NoteNote:  Add this line to the top of your "LocalSettings.php" file.

$smwgFallbackSearchType = function() {
	return new CirrusSearch(); 
};


→ MediaWiki 1.34.x and earlier:

$smwgFallbackSearchType = function() {
	return new \CirrusSearch();
};
This setting only has to be changed if the default search engine prior to using "SMWSearch" was explicitly changed to something else than null.

See also[edit]


References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:3940
  2. ^  Semantic MediaWiki: GitHub issue gh:smw:4830