Out of the box Fast Date Range Query Support from HST - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 10. There's an updated version available that covers our most recent release.

02-01-2017

Out of the box Fast Date Range Query Support from HST

The Hippo Repository has been extended to support fast date range queries.

When developing an application with Hippo's delivery tier, you can make use of that fast date range query support through the HstFilter API. For example, through  

import org.hippoecm.hst.content.beans.query.filter.Filter;
Filter#addBetween(String,
             java.util.Calendar,
             java.util.Calendar,
             org.hippoecm.repository.util.DateTools.Resolution)

Or 

import org.hippoecm.hst.content.beans.query.filter.Filter;
Filter#addGreaterThan(String,
       java.util.Calendar,
       org.hippoecm.repository.util.DateTools.Resolution)

Above, DateTools.Resolution can be one of the following values:

 

  1. DateTools.Resolution.YEAR
  2. DateTools.Resolution.MONTH
  3. DateTools.Resolution.DAY
  4. DateTools.Resolution.HOUR

The more coarse the resolution, the better the performance.  

 

Default Resolution used in HST 

By default, a resolution of  DateTools.Resolution.DAY is used for fast date range queries. For example, when using 

Filter#addBetween(String, Object, Object) 

where the first Object is the Calendar start value and the second Object is the Calendar end value, the default resolution  DateTools.Resolution.DAY is used.

You can change the default date resolution by means of the default.query.date.range.resolution value in the hst-config.properties file.

Supported values are 

  1. '' (empty string. Like this, Jackrabbit's default resolution of milliseconds is used)
  2. year
  3. month
  4. day
  5. hour

 

 

 

 

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?