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 $alternatives[0] ??= self::$BACKEND_NULL_PARAM;
98 $params[
'backend'] = [
99 ParamValidator::PARAM_DEFAULT => $this->searchEngineConfig->getSearchType(),
100 ParamValidator::PARAM_TYPE => $alternatives,
108 $params += $this->buildProfileApiParam();
176 $this->checkDependenciesSet();
178 if ( $params ==
null ) {
179 return $this->searchEngineFactory->create();
182 $type = $params[
'backend'] ??
null;
183 if (
$type === self::$BACKEND_NULL_PARAM ) {
186 $searchEngine = $this->searchEngineFactory->create(
$type );
187 $searchEngine->setNamespaces( $params[
'namespace'] );
188 $searchEngine->setLimitOffset( $params[
'limit'], $params[
'offset'] ?? 0 );
192 foreach ( $configs as $paramName => $paramConfig ) {
193 if ( isset( $params[$paramName] ) ) {
194 $searchEngine->setFeatureData(
195 $paramConfig[
'profile-type'],
200 return $searchEngine;