code: public static String getSolrRangeString(String from, String to) {
  
          // If a parameter is not initialized, use the asterisk '*' operator
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(from)) {
              from = "*";
          }
  
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(to)) {
              to = "*";
          }
  
          return String.format("[%s TO %s]", from, to);
      }
docs: Returns a string that represents a valid Solr query range.
  
  @param from Lower bound of the query range.
  @param to Upper bound of the query range.
  @return String that represents a Solr query range.