public function addSortBy(
        Result $result,
        string $field,
        string $mode
    ): ? string {
        $urlParameters = $this->generateQueryUrlParameters($result);

        if (
            isset($urlParameters['sort_by'][$field]) &&
            $urlParameters['sort_by'][$field] == $mode
        ) {
            return null;
        }

        if (
            !isset($urlParameters['sort_by']) &&
            SortBy::SCORE === [$field => $mode]
        ) {
            return null;
        }

        unset($urlParameters['sort_by']);

        if (SortBy::SCORE !== [$field => $mode]) {
            $urlParameters['sort_by'][$field] = $mode;
        }

        return $this->createUrlByUrlParameters(
            $result,
            $urlParameters
        )['route'];
    }