protected function getFilterRange($operator, $start, $end)
    {
        if (($operator === Operator::LT) || ($operator === Operator::LTE)) {
            $end = $start;
            $start = null;
        }

        switch ($operator) {
            case Operator::GT:
                $range = array(
                    'gt' => $start,
                );
                break;

            case Operator::GTE:
                $range = array(
                    'gte' => $start,
                );
                break;

            case Operator::LT:
                $range = array(
                    'lt' => $end,
                );
                break;

            case Operator::LTE:
                $range = array(
                    'lte' => $end,
                );
                break;

            case Operator::BETWEEN:
                $range = array(
                    'gte' => $start,
                    'lte' => $end,
                );
                break;

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

        return $range;
    }
protected function getFilterRange($operator, $start, $end)
    {
        if (($operator === Operator::LT) || ($operator === Operator::LTE)) {
            $end = $start;
            $start = null;
        }

        switch ($operator) {
            case Operator::GT:
                $range = array(
                    'gt' => $start,
                );
                break;

            case Operator::GTE:
                $range = array(
                    'gte' => $start,
                );
                break;

            case Operator::LT:
                $range = array(
                    'lt' => $end,
                );
                break;

            case Operator::LTE:
                $range = array(
                    'lte' => $end,
                );
                break;

            case Operator::BETWEEN:
                $range = array(
                    'gte' => $start,
                    'lte' => $end,
                );
                break;

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

        return $range;
    }
protected function getFilterRange ( $ operator , $ start , $ end ) { if ( ( $ operator === Operator :: LT ) || ( $ operator === Operator :: LTE ) ) { $ end = $ start ; $ start = null ; } switch ( $ operator ) { case Operator :: GT : $ range = array ( 'gt' => $ start , ) ; break ; case Operator :: GTE : $ range = array ( 'gte' => $ start , ) ; break ; case Operator :: LT : $ range = array ( 'lt' => $ end , ) ; break ; case Operator :: LTE : $ range = array ( 'lte' => $ end , ) ; break ; case Operator :: BETWEEN : $ range = array ( 'gte' => $ start , 'lte' => $ end , ) ; break ; default : throw new RuntimeException ( "Unknown operator '{$operator}'" ) ; } return $ range ; }
Get Elasticsearch range filter.

Start and end are optional, depending on the respective operator. Pass
null in this case. The operator may be one of:

- case Operator::GT:
- case Operator::GTE:
- case Operator::LT:
- case Operator::LTE:
- case Operator::BETWEEN:

@throws \RuntimeException If operator is no recognized

@param mixed $operator
@param mixed $start
@param mixed $end

@return string
Get Elasticsearch range filter .