}
public function execute() {
+ global $wgEnableMWSuggest;
$params = $this->extractRequestParams();
$search = $params['search'];
$limit = $params['limit'];
$namespaces = $params['namespace'];
+ $suggest = $params['suggest'];
+ # $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is disabled
+ if( $suggest && !$wgEnableMWSuggest ) return;
// Open search results may be stored for a very long time
$this->getMain()->setCacheMaxAge(1200);
public function getAllowedParams() {
return array (
'search' => null,
- 'limit' => array (
+ 'limit' => array(
ApiBase :: PARAM_DFLT => 10,
ApiBase :: PARAM_TYPE => 'limit',
ApiBase :: PARAM_MIN => 1,
ApiBase :: PARAM_TYPE => 'namespace',
ApiBase :: PARAM_ISMULTI => true
),
+ 'suggest' => false,
);
}
'search' => 'Search string',
'limit' => 'Maximum amount of results to return',
'namespace' => 'Namespaces to search',
+ 'suggest' => 'Do nothing if $wgEnableMWSuggest is false',
);
}
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiOpenSearch.php 35098 2008-05-20 17:13:28Z ialex $';
+ return __CLASS__ . ': $Id: ApiOpenSearch.php 47188 2009-02-12 17:27:05Z catrope $';
}
}