private function generateQueryUrlParameters(
        Result $result,
        string $filterName = null
    ): array {
        $query = $result->getQuery();
        $queryFilters = $query->getFilters();
        $urlParameters = [];
        foreach ($queryFilters as $currentFilterName => $filter) {
            /*
             * Special case for elements with LEVEL.
             */
            $urlParameters[$currentFilterName] = (
                !is_null($filterName) &&
                $currentFilterName === $filterName &&
                Filter::MUST_ALL_WITH_LEVELS === $filter->getApplicationType()
            )
                ? []
                : $filter->getValues();
        }

        unset($urlParameters['_query']);

        $queryFilter = $query->getFilter('_query');
        $queryString = $queryFilter instanceof Filter
            ? $queryFilter->getValues()[0]
            : '';

        if (!empty($queryString)) {
            $urlParameters['q'] = $queryString;
        }

        $sort = $query->getSortBy();
        if (SortBy::SCORE !== $sort) {
            $urlParameters['sort_by'] = $sort;
        }

        return $urlParameters;
    }