private String toExpression(Limit from, Limit to, int hitLimit) {
        if (from.equals(to) && hitLimit == 0) return from.number().toString();

        String expression = from.toRangeStart() + ";" + to.toRangeEnd();
        if (hitLimit == 0) return expression;

        // Insert ;hitLimit at the end inside the brackets
        return expression.substring(0, expression.length()-1) + ";" + hitLimit + expression.substring(expression.length()-1);
    }
Returns the simplest expression matching this
container-search/src/main/java/com/yahoo/prelude/query/IntItem.java