66 $this->checkDependenciesSet();
70 ParamValidator::PARAM_TYPE =>
'string',
71 ParamValidator::PARAM_REQUIRED =>
true,
74 ParamValidator::PARAM_DEFAULT =>
NS_MAIN,
75 ParamValidator::PARAM_TYPE =>
'namespace',
76 ParamValidator::PARAM_ISMULTI =>
true,
79 ParamValidator::PARAM_DEFAULT => 10,
80 ParamValidator::PARAM_TYPE =>
'limit',
81 IntegerDef::PARAM_MIN => 1,
82 IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1,
83 IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
86 if ( $isScrollable ) {
88 ParamValidator::PARAM_DEFAULT => 0,
89 IntegerDef::PARAM_MIN => 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;
99 ParamValidator::PARAM_DEFAULT => $this->searchEngineConfig->getSearchType(),
100 ParamValidator::PARAM_TYPE => $alternatives,
108 $params += $this->buildProfileApiParam();
176 $this->checkDependenciesSet();
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;