diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2018-08-21 14:57:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2018-08-21 14:57:13 +0000 |
commit | 9171317645de4d31c61c570a9e4fa765e09ecc4d (patch) | |
tree | 4c0f0c00e634df14cc1d0e2acf92f249317b70d8 /includes/search/SearchEngine.php | |
parent | 0a20a21168fdb16f75e622dc6919c6538798c28b (diff) | |
parent | c6a83871b59d2bfb6a8c77160b37fbfb2ca8edd6 (diff) | |
download | mediawikicore-9171317645de4d31c61c570a9e4fa765e09ecc4d.tar.gz mediawikicore-9171317645de4d31c61c570a9e4fa765e09ecc4d.zip |
Merge "Add Special:Search sort parameter without ui"
Diffstat (limited to 'includes/search/SearchEngine.php')
-rw-r--r-- | includes/search/SearchEngine.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 965a413508eb..ad9f93473018 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -32,6 +32,8 @@ use MediaWiki\MediaWikiServices; * @ingroup Search */ abstract class SearchEngine { + const DEFAULT_SORT = 'relevance'; + /** @var string */ public $prefix = ''; @@ -49,7 +51,7 @@ abstract class SearchEngine { /** @var bool */ protected $showSuggestion = true; - private $sort = 'relevance'; + private $sort = self::DEFAULT_SORT; /** @var array Feature values */ protected $features = []; @@ -346,13 +348,13 @@ abstract class SearchEngine { /** * Get the valid sort directions. All search engines support 'relevance' but others - * might support more. The default in all implementations should be 'relevance.' + * might support more. The default in all implementations must be 'relevance.' * * @since 1.25 * @return string[] the valid sort directions for setSort */ public function getValidSorts() { - return [ 'relevance' ]; + return [ self::DEFAULT_SORT ]; } /** |