67 $this->checkDependenciesSet();
71 ParamValidator::PARAM_TYPE =>
'string',
72 ParamValidator::PARAM_REQUIRED =>
true,
75 ParamValidator::PARAM_DEFAULT =>
NS_MAIN,
76 ParamValidator::PARAM_TYPE =>
'namespace',
77 ParamValidator::PARAM_ISMULTI =>
true,
80 ParamValidator::PARAM_DEFAULT => 10,
81 ParamValidator::PARAM_TYPE =>
'limit',
82 IntegerDef::PARAM_MIN => 1,
83 IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1,
84 IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
87 if ( $isScrollable ) {
89 ParamValidator::PARAM_DEFAULT => 0,
90 ParamValidator::PARAM_TYPE =>
'integer',
91 ApiBase::PARAM_HELP_MSG =>
'api-help-param-continue',
95 $alternatives = $this->searchEngineConfig->getSearchTypes();
96 if ( count( $alternatives ) > 1 ) {
97 if ( $alternatives[0] ===
null ) {
98 $alternatives[0] = self::$BACKEND_NULL_PARAM;
100 $params[
'backend'] = [
101 ParamValidator::PARAM_DEFAULT => $this->searchEngineConfig->getSearchType(),
102 ParamValidator::PARAM_TYPE => $alternatives,
110 $params += $this->buildProfileApiParam();
178 $this->checkDependenciesSet();
180 if ( $params ==
null ) {
181 return $this->searchEngineFactory->create();
184 $type = $params[
'backend'] ??
null;
185 if (
$type === self::$BACKEND_NULL_PARAM ) {
188 $searchEngine = $this->searchEngineFactory->create(
$type );
189 $searchEngine->setNamespaces( $params[
'namespace'] );
190 $searchEngine->setLimitOffset( $params[
'limit'], $params[
'offset'] ?? 0 );
194 foreach ( $configs as $paramName => $paramConfig ) {
195 if ( isset( $params[$paramName] ) ) {
196 $searchEngine->setFeatureData(
197 $paramConfig[
'profile-type'],
202 return $searchEngine;