65 $this->checkDependenciesSet();
69 ParamValidator::PARAM_TYPE =>
'string',
70 ParamValidator::PARAM_REQUIRED =>
true,
73 ParamValidator::PARAM_DEFAULT =>
NS_MAIN,
74 ParamValidator::PARAM_TYPE =>
'namespace',
75 ParamValidator::PARAM_ISMULTI =>
true,
78 ParamValidator::PARAM_DEFAULT => 10,
79 ParamValidator::PARAM_TYPE =>
'limit',
80 IntegerDef::PARAM_MIN => 1,
81 IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1,
82 IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
85 if ( $isScrollable ) {
87 ParamValidator::PARAM_DEFAULT => 0,
88 IntegerDef::PARAM_MIN => 0,
89 ParamValidator::PARAM_TYPE =>
'integer',
90 ApiBase::PARAM_HELP_MSG =>
'api-help-param-continue',
94 $alternatives = $this->searchEngineConfig->getSearchTypes();
95 if ( count( $alternatives ) > 1 ) {
96 $alternatives[0] ??= self::$BACKEND_NULL_PARAM;
97 $params[
'backend'] = [
98 ParamValidator::PARAM_DEFAULT => $this->searchEngineConfig->getSearchType(),
99 ParamValidator::PARAM_TYPE => $alternatives,
107 $params += $this->buildProfileApiParam();
175 $this->checkDependenciesSet();
177 if ( $params ==
null ) {
178 return $this->searchEngineFactory->create();
181 $type = $params[
'backend'] ??
null;
182 if ( $type === self::$BACKEND_NULL_PARAM ) {
185 $searchEngine = $this->searchEngineFactory->create( $type );
186 $searchEngine->setNamespaces( $params[
'namespace'] );
187 $searchEngine->setLimitOffset( $params[
'limit'], $params[
'offset'] ?? 0 );
191 foreach ( $configs as $paramName => $paramConfig ) {
192 if ( isset( $params[$paramName] ) ) {
193 $searchEngine->setFeatureData(
194 $paramConfig[
'profile-type'],
199 return $searchEngine;