44 public function create( $type =
null ) {
45 $configuredClass = $this->config->getSearchType();
46 $alternativesClasses = $this->config->getSearchTypes();
48 if ( $type !==
null && in_array( $type, $alternativesClasses ) ) {
50 } elseif ( $configuredClass !==
null ) {
51 $class = $configuredClass;
53 $class = self::getSearchEngineClass( $this->dbProvider );
56 $mappings = $this->config->getSearchMappings();
59 $spec = $mappings[$class] ?? [
'class' => $class ];
63 if ( isset( $spec[
'class'] ) && is_subclass_of( $spec[
'class'], SearchDatabase::class ) ) {
64 $args[
'extraArgs'][] = $this->dbProvider;
69 $engine = ObjectFactory::getObjectFromSpec( $spec, $args );
71 $engine->setHookContainer( $this->hookContainer );