28 $configuredClass = $this->config->getSearchType();
29 $alternativesClasses = $this->config->getSearchTypes();
31 $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
32 if (
$type !==
null && in_array(
$type, $alternativesClasses ) ) {
34 } elseif ( $configuredClass !==
null ) {
35 $class = $configuredClass;
37 $class = self::getSearchEngineClass( $lb );
40 if ( is_subclass_of( $class, SearchDatabase::class ) ) {
41 return new $class( $lb );