protected function getRange($operator, $start, $end)
    {
        $startBrace = '[';
        $startValue = '*';
        $endValue = '*';
        $endBrace = ']';

        $start = '"' . $this->escapeQuote($this->toString($start), true) . '"';
        $end = '"' . $this->escapeQuote($this->toString($end), true) . '"';

        switch ($operator) {
            case Operator::GT:
                $startBrace = '{';
                $endBrace = '}';
                // Intentionally omitted break

            case Operator::GTE:
                $startValue = $start;
                break;

            case Operator::LT:
                $startBrace = '{';
                $endBrace = '}';
                // Intentionally omitted break

            case Operator::LTE:
                $endValue = $end;
                break;

            case Operator::BETWEEN:
                $startValue = $start;
                $endValue = $end;
                break;

            default:
                throw new \RuntimeException("Unknown operator: $operator");
        }

        return "$startBrace$startValue TO $endValue$endBrace";
    }