public function getForJsonFacet($sorting, $direction)
    {
        $isMetricSorting = strpos($sorting, 'metrics_') === 0;
        $expression = $isMetricSorting ? $sorting : $this->getForFacet($sorting);
        $direction = strtolower($direction);
        if (!empty($direction) && in_array($direction, ['asc', 'desc'])) {
            $expression .= ' ' . $direction;
        }
        return $expression;
    }