$smwg­Fallback­Search­Type

From Linux Web Expert


Template:Interlanguagelink: en
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


__NOBREADCRUMBLINKS__

$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 an unknown date unknown versions of MediaWiki. Starting with Semantic MediaWiki 3.1.0Released on an unknown date unknown versions of MediaWiki compatibility with other search types than SearchMySQL, SearchPostgres or SearchOracle was improved.1

Default setting

$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

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;

File:OOjs UI icon lightbulb-yellow.svg <translate> Note:</translate> 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

#scite could not render a citation text for reference "gh:smw:3940" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:4830" because type "issue" was not assigned to a template.

References

  1. ^ gh:smw:3940 
  2. ^ gh:smw:4830