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;
    }
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;
    }
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 ; }
Return expression for facet sorting combined with direction

@param string $sorting
@param string $direction
@return string
Return expression for facet sorting combined with direction