code: private String appendRange(final String value, final boolean inclusive, final boolean isGreaterThan,
              final Class clazz)
      {
          String appender = " ";
          StringBuilder sb = new StringBuilder();
          sb.append(":");
          sb.append(inclusive ? "[" : "{");
          sb.append(isGreaterThan ? value : "*");
          sb.append(appender);
          sb.append("TO");
          sb.append(appender);
          // composite key over lucene is not working issue #491
          if (clazz != null
                  && (clazz.isAssignableFrom(int.class) || clazz.isAssignableFrom(Integer.class)
                          || clazz.isAssignableFrom(short.class) || clazz.isAssignableFrom(long.class)
                          || clazz.isAssignableFrom(Timestamp.class) || clazz.isAssignableFrom(Long.class)
                          || clazz.isAssignableFrom(float.class) || clazz.isAssignableFrom(Float.class)
                          || clazz.isAssignableFrom(BigDecimal.class) || clazz.isAssignableFrom(Double.class) || clazz
                              .isAssignableFrom(double.class)))
          {
              sb.append(isGreaterThan ? "*" : value);
  
          }
          else
          {
  
              sb.append(isGreaterThan ? "null" : value);
          }
  
          sb.append(inclusive ? "]" : "}");
          return sb.toString();
      }
docs: Append range.
  
  @param value
  the value
  @param inclusive
  the inclusive
  @param isGreaterThan
  the is greater than
  @return the string