Help:Con­figu­ration para­meter "$smwgQSortFeatures"

From semantic-mediawiki.org


Configuration parameter details:
Title $smwgQSortFeatures
Description Sets the behaviour for the sorting features of the Semantic search
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Query settings
Keyword query · sorting · semantic search

$smwgQSortFeatures is a configuration parameter that sets behaviour for the sorting features of the Semantic search. The configuration parameter was introduced in Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x.1 and deprecated the configuration parameters as indicated in the section on available options below.

The deprecated configuration settings as indicated in the section on available options should be migrated to this configuration setting in "LocalSettings.php" since they will be removed with the release of Semantic MediaWiki 3.1.0Released on an unknown date and compatible with unknown versions of MediaWiki. in late 2018.1

Default setting

$smwgQSortFeatures = SMW_QSORT | SMW_QSORT_RANDOM;

This means that the two respective features as explained in the following sections on available options are enabled.

Available options

NoteNote: This option replaces configuration parameter $smwgQSortingSupportSets whether sorting of query results should be possible.
  • SMW_QSORT_RANDOM – Sets that random sorting of query results is possible
NoteNote: This option replaces configuration parameter $smwgQRandSortingSupportSets whether random sorting of query results should be possible.
For further information on the available options listed above see the documentation pages of the respective deprecated configuration parameters as stated above.

Changing the default setting

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

Removing a specific query sorting feature

To disable a specific feature e.g. random sorting of query results just redefine the configuration parameter by defining it without including the corresponding constant as shown in the above section on available options:

$smwgQSortFeatures = SMW_QSORT;

or alternatively remove the option from the existing definition of the configuration parameter like e.g.

$smwgQSortFeatures = ( $smwgQSortFeatures & ~SMW_QSORT_RANDOM );
NoteNote: Please use parentheses2 when combining different bit-operations to avoid a possible mismatch.
Disabling all query sorting features

To disable all browse features just remove all constants as shown in the above section on available options:

$smwgQSortFeatures = '';

or add the constant for disabling all query sorting features

$smwgQSortFeatures = SMW_QSORT_NONE;

See also

References

  1. a b  Semantic MediaWiki: GitHub pull request gh:smw:2821
  2. ^  Bitwise Operators to use parentheses to ensure the desired precedence ...