public static String getDateCreatedTimeRangeFilterQuery(String searchField, long startTime, long endTime) {

        String sStartTime = null;
        String sEndTime = null;

        // Convert startTime to ISO 8601 format
        if ((startTime > Long.MIN_VALUE) && (startTime < Long.MAX_VALUE)) {
            sStartTime = CmsSearchUtil.getDateAsIso8601(new Date(startTime));
        }

        // Convert endTime to ISO 8601 format
        if ((endTime > Long.MIN_VALUE) && (endTime < Long.MAX_VALUE)) {
            sEndTime = CmsSearchUtil.getDateAsIso8601(new Date(endTime));
        }

        // Build Solr range string
        final String rangeString = CmsSearchUtil.getSolrRangeString(sStartTime, sEndTime);

        // Build Solr filter string
        return String.format("%s:%s", searchField, rangeString);
    }
public static String getDateCreatedTimeRangeFilterQuery ( String searchField , long startTime , long endTime ) { String sStartTime = null ; String sEndTime = null ; if ( ( startTime > Long . MIN_VALUE ) && ( startTime < Long . MAX_VALUE ) ) { sStartTime = CmsSearchUtil . getDateAsIso8601 ( new Date ( startTime ) ) ; } if ( ( endTime > Long . MIN_VALUE ) && ( endTime < Long . MAX_VALUE ) ) { sEndTime = CmsSearchUtil . getDateAsIso8601 ( new Date ( endTime ) ) ; } final String rangeString = CmsSearchUtil . getSolrRangeString ( sStartTime , sEndTime ) ; return String . format ( "%s:%s" , searchField , rangeString ) ; }
Returns a time interval as Solr compatible query string.
@param searchField the field to search for.
@param startTime the lower limit of the interval.
@param endTime the upper limit of the interval.
@return Solr compatible query string.