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();
60 if ( isset( $mappings[$class] ) ) {
61 $spec = $mappings[$class];
64 $spec = [
'class' => $class ];
69 if ( isset( $spec[
'class'] ) && is_subclass_of( $spec[
'class'], SearchDatabase::class ) ) {
70 $args[
'extraArgs'][] = $this->loadBalancer;
75 $engine = ObjectFactory::getObjectFromSpec( $spec,
$args );
77 $engine->setHookContainer( $this->hookContainer );