protected Query stringRange(Path<?> leftHandSide, String field,
            @Nullable Expression<?> min, @Nullable Expression<?> max,
            boolean minInc, boolean maxInc, QueryMetadata metadata) {

        if (min == null) {
            return TermRangeQuery.newStringRange(field, null,
                    convert(leftHandSide, max, metadata)[0], minInc, maxInc);
        } else if (max == null) {
            return TermRangeQuery.newStringRange(field,
                    convert(leftHandSide, min, metadata)[0], null, minInc,
                    maxInc);
        } else {
            return TermRangeQuery.newStringRange(field,
                    convert(leftHandSide, min, metadata)[0],
                    convert(leftHandSide, max, metadata)[0], minInc, maxInc);
        }
    }
If the query is a BooleanQuery and it contains a single Occur.MUST_NOT
clause it will be returned as is. Otherwise it will be wrapped in a
BooleanClause with the given Occur.
querydsl-lucene5/src/main/java/com/querydsl/lucene5/LuceneSerializer.java