public function getSearchFactory(): SearchFactory
    {
        $extensions = $this->extensions;

        if (\count($this->types) > 0 || \count($this->typeExtensions) > 0) {
            $extensions[] = new PreloadedExtension($this->types, $this->typeExtensions);
        }

        $resolvedTypeFactory = $this->resolvedTypeFactory ?? new GenericResolvedFieldTypeFactory();
        $registry = new GenericTypeRegistry($extensions, $resolvedTypeFactory);

        return new GenericSearchFactory($registry, $this->fieldSetRegistry ?? LazyFieldSetRegistry::create());
    }