Class StatisticsSolrDateFilter

  • All Implemented Interfaces:
    StatisticsFilter

    public class StatisticsSolrDateFilter
    extends Object
    implements StatisticsFilter
    Encapsulate a range of dates for Solr query filtering.
    Author:
    Kevin Van de Velde (kevin at atmire dot com)
    • Constructor Detail

      • StatisticsSolrDateFilter

        public StatisticsSolrDateFilter()
    • Method Detail

      • setStartStr

        public void setStartStr​(String startStr)
        Set the start date as a string expression.
        Parameters:
        startStr - statistics start date as a string Must be paired with setEndStr(String).
      • setEndStr

        public void setEndStr​(String endStr)
        Set the end date as a string expression.
        Parameters:
        endStr - statistics end date as a string Must be paired with setStartStr(String).
      • setTypeStr

        public void setTypeStr​(String typeStr)
        Set the range granularity: DAY, MONTH, or YEAR.
        Parameters:
        typeStr - which granularity (case insensitive string: "day" / "month" / "year")
      • setStartDate

        public void setStartDate​(Date startDate)
        Set the start date as a Date object.
        Parameters:
        startDate - statistics start date object Must be paired with setEndDate(Date).
      • setEndDate

        public void setEndDate​(Date endDate)
        Set the end date as a Date object.
        Parameters:
        endDate - statistics end date object Must be paired with setStartDate(Date).
      • toQuery

        public String toQuery()
        Convert the date range to a filter expression.
        Specified by:
        toQuery in interface StatisticsFilter
        Returns:
        Solr date filter expression