title: Solr 1.4 Date Facet Include
body: <p>My goal is to get a document count for each month over the past year. Here is the faceted query I am using against Solr 1.4:</p>
  
  <pre><code>q=*:*
  rows=0
  facet=on
  facet.date=myDateField
  facet.date.start=NOW-11MONTH/MONTH
  facet.date.end=NOW+1MONTH/MONTH
  facet.date.gap=+1MONTH
  </code></pre>
  
  <p>The ranges this query produces are <code>2013-01-01T00:00:00Z to 2013-02-01T00:00:00Z</code>, which is inclusive for the upper bound, meaning <code>T00:00:00Z</code> on the first of every month is being counted in 2 different ranges. </p>
  
  <p><a href="http://wiki.apache.org/solr/SimpleFacetParameters#facet.date.include" rel="nofollow">Solr 3.1 introduces</a> the <code>facet.date.include</code> parameter that would solve my problem, except upgrading right now is not an option. Is there a workaround to achieving the same functionality? I tried <code>facet.date.gap=+1MONTH-1SECOND</code> which is close, but not close enough. It produces something like this where the end date is not correct:</p>
  
  <pre><code>2012-09-01T00:00:00Z
  2012-09-30T23:59:59Z
  2012-10-30T23:59:58Z
  2012-11-30T23:59:57Z
  2012-12-30T23:59:56Z
  2013-01-30T23:59:55Z
  2013-02-28T23:59:54Z
  2013-03-28T23:59:53Z
  2013-04-28T23:59:52Z
  </code></pre>