@param \Spryker\Client\Search\Dependency\Plugin\QueryInterface $searchQuery
@param array $requestParameters

@return \Spryker\Client\Search\Dependency\Plugin\QueryInterface
557869
public function expandQuery(QueryInterface $searchQuery, array $requestParameters = []): QueryInterface
    {
        if ($this->hasWarehouseValue($requestParameters)) {
            $this->addWarehouseToQuery($searchQuery->getSearchQuery(), $this->getWarehouseValueFrom($requestParameters));
        }

        return $searchQuery;
    }
758059
public final function doQuery(string $query, array $queryParams = null): BatchInterface
    {
        return $this->queue($query, $queryParams)->do();
    }
451380
public function searchKeyword($query, KeywordSearchQuery $parameters, array $headers = [])
    {
        $data = $this->getApi()->searchKeyword($query, $this->getParameters($parameters), $headers);

        return $this->getKeywordFactory()->createResultCollection($data);
    }
1270563
protected function getOptionsFromArray($scope, $searchQuery = null)
    {
        /*
         * Load the data
         */
        $options = $scope->options;

        if (is_scalar($options)) {
            $model = $this->scopeModels[$scope->scopeName];
            $methodName = $options;

            if (!$model->methodExists($methodName)) {
                throw new ApplicationException(Lang::get('backend::lang.filter.options_method_not_exists', [
                    'model'  => get_class($model),
                    'method' => $methodName,
                    'filter' => $scope->scopeName
                ]));
            }

            $options = $model->$methodName();
        }
        elseif (!is_array($options)) {
            $options = [];
        }

        /*
         * Apply the search
         */
        $searchQuery = Str::lower($searchQuery);
        if (strlen($searchQuery)) {
            $options = $this->filterOptionsBySearch($options, $searchQuery);
        }

        return $options;
    }
91634
public static function getQueryParams($searchParams) {
        $query = $searchParams->query;
        $hits = $searchParams->config->hits;

        return array('query' => $query, 'hit' => $hits);
    }
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;
    }
606382
public function applyFilters($searchColumns, $searchValue)
    {
        $this->query = FilterAgent::applyFiltersTo($this->class, $this->query, $searchColumns, $searchValue);
        $this->filteredCount = $this->query->count();
    }
339766
public function setGlobalSearchParameters($searchKeywordParameters, $searchCategoryParameters)
    {
        Piwik::checkUserHasSuperUserAccess();
        Option::set(self::OPTION_SEARCH_KEYWORD_QUERY_PARAMETERS_GLOBAL, $searchKeywordParameters);
        Option::set(self::OPTION_SEARCH_CATEGORY_QUERY_PARAMETERS_GLOBAL, $searchCategoryParameters);
        Cache::deleteTrackerCache();
        return true;
    }
398167
public static function addQueryParameters(UriInterface $uri, array $queryParameters)
    {
        $originalQuery = $uri->getQuery();
        $originalQueryParameters = [];
        parse_str($originalQuery, $originalQueryParameters);
        $newQueryParameters = array_replace_recursive($originalQueryParameters, $queryParameters);
        $newQuery = http_build_query($newQueryParameters);
        $newUri = $uri->withQuery($newQuery);
        return $newUri;
    }
200902
private static function parseQueryParameters(?string $queryString): ParameterCollectionInterface
    {
        $parameters = new ParameterCollection();

        if ($queryString === null) {
            return $parameters;
        }

        parse_str($queryString, $parametersArray);
        foreach ($parametersArray as $parameterName => $parameterValue) {
            $parameters->set($parameterName, is_array($parameterValue) ? $parameterValue[0] : $parameterValue);
        }

        return $parameters;
    }
929709
protected function search(Builder $query, Request $request): Builder
    {
        $phrase = $request->input('q');

        if (!$phrase || strlen($phrase) < $this->minimumSearchInputLength) {
            return $query;
        }

        if ($this->translationModel()) {
            return $this->searchQueryTranslations($query, $phrase);
        }

        return $this->searchQuery($query, $phrase);
    }
756484
final public function create(SearchEventsRequest $request, ParsedQuery $parsedQuery): Query
    {
        $this->applyDateFilters($request, $parsedQuery);

        $method = 'for' . ucfirst($request::schema()->getHandlerMethodName(false));
        if (is_callable([$this, $method])) {
            $query = $this->$method($request, $parsedQuery);
        } else {
            $query = $this->forSearchEventsRequest($request, $parsedQuery);
        }

        return Query::create($query);
    }
339243
public function findModels($searchQuery, $regionId, $page = null, $pageSize = null, $currency = null)
    {
        $resource = sprintf('models.%s', self::DECODE_TYPE_DEFAULT);
        $queryParams = $this->filterParams([
            'query' => $searchQuery,
            'regionId' => $regionId,
            'page' => $page,
            'pageSize' => $pageSize,
            'currency' => $currency,
        ]);

        $response = $this->sendRequest('GET', $this->getServiceUrl($resource), ['query' => $queryParams]);
        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        return new GetMarketModelsResponse($decodedResponseBody);
    }
1022598
public function execute($requestParams = array()){

        $this->getQueryBuilder()->setBulkInsert($requestParams);
       
        $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::SAVE_QUERY, QueryBuilder::PARENT_ONLY);

        $this->beginTransaction();
        try{
            $result = $this->query("$query", FALSE);
      
            $this->commitTransaction();
        }catch(Exception $e){
          
            error_log($e->getMessage());
            $this->rollbackTransaction();
        }
        if(array_key_exists('locale', $requestParams)) {
            $requestParams['locale'] = $this->parseJson($requestParams['locale']);
        }
      
        return array(get_class($this->entity) => $requestParams);
    }
926292
public function execute(SearchParams $searchParams) {
        $path = self::getPath($searchParams);
        $builder = new UrlParamsBuilder($searchParams);
        return $this->openSearchClient->get($path, $builder->getHttpParams());
    }
861802
public function buildSearch(SearchRequest $request, $filters = null)
    {
        $search = new Search();

        /** @var FilterInterface[] $filters */
        $filters = $filters ? $filters : $this->all();
        foreach ($filters as $name => $filter) {
            $filter->modifySearch($search, $request->get($name), $request);
        }

        return $search;
    }
663527
public function buildSearchRequest(RequestInterface $request)
    {
        $searchRequest = [
            'size' => $request->getSize(),
        ];

        if ($searchRequest['size'] > 0) {
            $searchRequest['sort'] = $this->getSortOrders($request);
            $searchRequest['from'] = $request->getFrom();
        }

        $query = $this->getRootQuery($request);
        if ($query) {
            $searchRequest['query'] = $query;
        }

        $filter = $this->getRootFilter($request);
        if ($filter) {
            $searchRequest['post_filter'] = $filter;
        }

        $aggregations = $this->getAggregations($request);
        if (!empty($aggregations)) {
            $searchRequest['aggregations'] = $aggregations;
        }

        return $searchRequest;
    }