dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Introduce ContentHandler::getSecondaryDataUpdates."
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialSearch.php
diff --git
a/includes/specials/SpecialSearch.php
b/includes/specials/SpecialSearch.php
index
78a54f5
..
86dcb72
100644
(file)
--- a/
includes/specials/SpecialSearch.php
+++ b/
includes/specials/SpecialSearch.php
@@
-76,6
+76,11
@@
class SpecialSearch extends SpecialPage {
*/
protected $fulltext;
*/
protected $fulltext;
+ /**
+ * @var string
+ */
+ protected $sort;
+
/**
* @var bool
*/
/**
* @var bool
*/
@@
-198,6
+203,11
@@
class SpecialSearch extends SpecialPage {
$this->setExtraParam( 'prefix', $this->mPrefix );
}
$this->setExtraParam( 'prefix', $this->mPrefix );
}
+ $this->sort = $request->getVal( 'sort', SearchEngine::DEFAULT_SORT );
+ if ( $this->sort !== SearchEngine::DEFAULT_SORT ) {
+ $this->setExtraParam( 'sort', $this->sort );
+ }
+
$user = $this->getUser();
# Extract manually requested namespaces
$user = $this->getUser();
# Extract manually requested namespaces
@@
-301,6
+311,7
@@
class SpecialSearch extends SpecialPage {
$search->setFeatureData( 'rewrite', $this->runSuggestion );
$search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
$search->setFeatureData( 'rewrite', $this->runSuggestion );
$search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
+ $search->setSort( $this->sort );
$search->prefix = $this->mPrefix;
Hooks::run( 'SpecialSearchSetupEngine', [ $this, $this->profile, $search ] );
$search->prefix = $this->mPrefix;
Hooks::run( 'SpecialSearchSetupEngine', [ $this, $this->profile, $search ] );
@@
-709,9
+720,10
@@
class SpecialSearch extends SpecialPage {
*/
public function getSearchEngine() {
if ( $this->searchEngine === null ) {
*/
public function getSearchEngine() {
if ( $this->searchEngine === null ) {
+ $services = MediaWikiServices::getInstance();
$this->searchEngine = $this->searchEngineType ?
$this->searchEngine = $this->searchEngineType ?
-
MediaWikiServices::getInstance()
->getSearchEngineFactory()->create( $this->searchEngineType ) :
-
MediaWikiServices::getInstance()
->newSearchEngine();
+
$services
->getSearchEngineFactory()->create( $this->searchEngineType ) :
+
$services
->newSearchEngine();
}
return $this->searchEngine;
}
return $this->searchEngine;