Retireve the spelling type for a fulltext query.

@param ContainerConfigurationInterface $containerConfig Search request configuration.
@param string|string[]                 $queryText       Query text.

@return int
554053
private function getSpellingType(ContainerConfigurationInterface $containerConfig, $queryText)
    {
        if (is_array($queryText)) {
            $queryText = implode(" ", $queryText);
        }

        $spellcheckRequestParams = [
            'index'           => $containerConfig->getIndexName(),
            'type'            => $containerConfig->getTypeName(),
            'queryText'       => $queryText,
            'cutoffFrequency' => $containerConfig->getRelevanceConfig()->getCutOffFrequency(),
        ];

        $spellcheckRequest = $this->spellcheckRequestFactory->create($spellcheckRequestParams);
        $spellingType      = $this->spellchecker->getSpellingType($spellcheckRequest);

        return $spellingType;
    }
702510
public function vote($config, Context $context)
    {
        if (!$config instanceof FilterInterface) {
            throw new FlaggingException(
                sprintf('%s parameter must be FilterInterface in %s, %s given', '$config', __CLASS__, gettype($config))
            );
        }

        if (null === $result = $context->getResultCache()->getResult((string) $config)) {
            $context->getResultCache()->addResult(
                (string) $config,
                $result = $this->filterVoter->vote($config, $context)
            );
        }

        return $result;
    }
1092328
public function configurePageServices(ContainerBuilder $container, array $config)
    {
        // set the default page service to use when no page type has been set. (backward compatibility)
        $definition = $container->getDefinition('sonata.page.page_service_manager');
        $definition->addMethodCall('setDefault', [new Reference($config['default_page_service'])]);
    }
1321156
public function vote($config, Context $context)
    {
        if (!$config instanceof FilterInterface) {
            throw new FlaggingException(
                sprintf('%s parameter must be FilterInterface in %s, %s given', '$config', __CLASS__, gettype($config))
            );
        }

        return $this->voterManager->getVoter($config->getName())->vote($config->getParameter(), $context);
    }
897088
public function prepareConfig(array $config, ContainerBuilder $container)
    {
        $default = $this->getJoomlaConfig($container);

        $reset = [
            'debug',
            'log_path',
            'tmp_path',
            'secret'
        ];

        foreach ($default as $key => $value) {
            if (in_array($key, $reset)) {
                unset($default[$key]);
            }
        }

        $config = array_merge(
            $default,
            $this->getDefaultConfig(),
            $config
        );

        return $config;
    }
952735
public function getConfiguration(array $config, ContainerBuilder $container)
    {
        $configuration = $this->getConfigurationInstance();
        if ($configuration) {
            $container->addObjectResource($configuration);
        }

        return $configuration;
    }
1018768
public function findForPaginateFilterBySiteIds(PaginateFinderConfiguration $configuration, $language, array $siteIds)
    {
        $qa = $this->createAggregationQuery();

        $this->filterSearchAndSiteIds($configuration, $language, $siteIds, $qa);

        $order = $configuration->getOrder();
        if (!empty($order)) {
            $qa->sort($order);
        }

        $qa->skip($configuration->getSkip());
        $qa->limit($configuration->getLimit());

        return $this->hydrateAggregateQuery($qa);
    }
309864
public function load(ContainerBuilder $container, array $config)
    {
        if (isset($config['connection_details'])) {
            DEFINE('SQLDBENGINE', $config['connection_details']['engine']);
            DEFINE('SQLDBHOST', $config['connection_details']['host']);
            DEFINE('SQLDBSCHEMA', $config['connection_details']['schema']);
            DEFINE('SQLDBNAME', $config['connection_details']['dbname']);
            DEFINE('SQLDBUSERNAME', $config['connection_details']['username']);
            DEFINE('SQLDBPASSWORD', $config['connection_details']['password']);
            DEFINE('SQLDBPREFIX', $config['connection_details']['dbprefix']);
            session_start();
            // Store any keywords set in behat.yml file
            if (isset($config['keywords']) and $config['keywords']) {
                foreach ($config['keywords'] as $keyword => $value) {
                    $_SESSION['behat']['GenesisSqlExtension']['keywords'][$keyword] = $value;
                }
            }

            // Set 'notQuotableKeywords' for later use.
            $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];

            if (isset($config['notQuotableKeywords'])) {
                $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = $config['notQuotableKeywords'];
            }
        }
    }
104665
public function applyOptimizers(ContainerConfigurationInterface $containerConfiguration, QueryInterface $query)
    {
        $functions = $this->getFunctions($containerConfiguration);

        if (isset($this->filters[$containerConfiguration->getName()])) {
            $optimizerIds = $this->filters[$containerConfiguration->getName()]->getOptimizerIds() ?? array_keys($functions);
            $functions = array_intersect_key($functions, array_flip($optimizerIds));
        }

        return $this->applyFunctions($query, $functions);
    }
1233142
public static function queryByParent( $parentId, $parentType, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return static::find()->where( 'parentId=:pid AND parentType=:ptype AND siteId=:siteId', [ ':pid' => $parentId, ':ptype' => $parentType, ':siteId' => $siteId ] );
		}
		else {

			return static::find()->where( 'parentId=:pid AND parentType=:ptype', [ ':pid' => $parentId, ':ptype' => $parentType ] );
		}
	}
882800
private function validateBrowserType(ContainerBuilder $container, string $valueType): void
    {
        if ($container->has(sprintf('netgen_content_browser.config.%s', $valueType))) {
            return;
        }

        throw new RuntimeException(
            sprintf(
                'Netgen Content Browser backend for "%s" value type does not exist.',
                $valueType
            )
        );
    }
121713
private function configurePlugin(ContainerBuilder $container, $serviceId, $pluginName, array $pluginConfig)
    {
        $pluginServiceId = $serviceId.'.plugin.'.$pluginName;

        $definition = class_exists(ChildDefinition::class)
            ? new ChildDefinition('httplug.plugin.'.$pluginName)
            : new DefinitionDecorator('httplug.plugin.'.$pluginName);

        $this->configurePluginByName($pluginName, $definition, $pluginConfig, $container, $pluginServiceId);
        $container->setDefinition($pluginServiceId, $definition);

        return $pluginServiceId;
    }
109410
protected static function ctxGetContainer(ContextInterface $context): ContainerInterface
    {
        assert(static::ctxHasContainer($context));

        return $context->get(ContextProperties::CTX_CONTAINER);
    }
2444
public function getCategorySearchQuery(
        ContainerConfigurationInterface $containerConfigurationInterface,
        CategoryInterface $category
    ) {
        $filters = array_merge(
            ['category' => $this->categoryFilterProvider->getQueryFilter($category)],
            $containerConfigurationInterface->getFilters()
        );

        $filterQuery  = $this->queryBuilder->createFilterQuery($containerConfigurationInterface, $filters);

        return $this->queryFactory->create(QueryInterface::TYPE_FILTER, ['filter' => $filterQuery]);
    }
948929
public function getDriver(Container $config)
        {
            $connObject = new Configuration();
            $config = $config->assoc();

            // We map our config options to Doctrine's naming of them
            $connParamsMap = array(
                'database' => 'dbname',
                'username' => 'user',
                'hostname' => 'host',
                'pass'     => 'password'
            );

            foreach ($connParamsMap as $key => $param) {
                if (isset($config[$key])) {
                    $config[$param] = $config[$key];
                    unset($config[$key]);
                }
            }

            $type = isAke($config, 'type', 'pdo_mysql');

            $config['driver'] = $type;
            unset($config['type']);

            return DriverManager::getConnection($config, $connObject);
        }
133048
private function getSearchQueryLimitation($entity, $searchContainers)
    {
        $applyTo = (bool) ($searchContainers['quick_search_container'] ?? ($searchContainers['catalog_product_autocomplete'] ?? false));

        if ($applyTo) {
            $containerData = ['apply_to' => (int) true];
            $queryIds      = $this->resource->getQueryIdsByOptimizer($entity);

            if (!empty($queryIds)) {
                $containerData['query_ids'] = $queryIds;
            }
            $entity->setData('quick_search_container', $containerData);
        }

        return $entity;
    }
385532
public function configureSettings($config, ContainerBuilder $container)
    {
        $container->setParameter('bruery.doctrine_orm_admin.settings.manager.clas',             $config['settings']['class']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.proxy_query.class',        $config['settings']['proxy_query']['class']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.model_manager.class',      $config['settings']['model_manager']['class']);
        $container->setParameter('bruery.doctrine_orm_admin.settings',                          $config['settings']['doctrine_cache']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.doctrine_cache.enabled',   $config['settings']['doctrine_cache']['enabled']);
        $container->setParameter('bruery.doctrine_orm_admin.settings.doctrine_cache.ttl',       $config['settings']['doctrine_cache']['ttl']);

        if ($config['settings']['doctrine_cache']['enabled']) {
            $definition = $container->getDefinition('bruery.doctrine_orm_admin.settings.manager');
            $definition->addMethodCall('setConfig', array('doctrine_cache',  $config['settings']['doctrine_cache']));
        }
    }