47 $configuredClass = $this->config->getSearchType();
48 $alternativesClasses = $this->config->getSearchTypes();
50 if (
$type !==
null && in_array(
$type, $alternativesClasses ) ) {
52 } elseif ( $configuredClass !==
null ) {
53 $class = $configuredClass;
55 $class = self::getSearchEngineClass( $this->loadBalancer );
58 $mappings = $this->config->getSearchMappings();
61 $spec = $mappings[$class] ?? [
'class' => $class ];
65 if ( isset( $spec[
'class'] ) && is_subclass_of( $spec[
'class'], SearchDatabase::class ) ) {
66 $args[
'extraArgs'][] = $this->loadBalancer;
71 $engine = ObjectFactory::getObjectFromSpec( $spec,
$args );
73 $engine->setHookContainer( $this->hookContainer );