On our server the facet_date facet data in $response is returning:
stdClass Object
(
[2009-08-04T10:00:00Z] => 0
[2009-09-04T10:00:00Z] => 9
[2009-10-04T10:00:00Z] => 0
[gap] => +1MONTH
[end] => 2009-11-04T10:00:00Z
)
and the facet title is returning "September" for [2009-09-04T10:00:00Z]. With gap set at 1month, when this facet link is clicked, results from October are also returned.
Because solr is returning this facet data, and the query from apachesolr doesn't appear to contain any constraints that would cause this behaviour, I think the problem may be a bug with solr itself. However, should apachesolr be checking if date_facet data start and end points coincide with start and end times for a month, and amending the facet link if they are not?
Thanks
Stuart
Comments
Comment #1
pwolanin commentedAll times are currently only in UTC, so depending on your time zone, you could be seeing it for that reason
Comment #2
anarchivist commentedThis appears to be a duplicate of #558036: Date facet rounding bug.
Comment #3
stuzza commentedWhile this may well be a duplicate, I'm reluctant to post the following to #558036: Date facet rounding bug because it doesn't really follow from the specifics of the original bug. Apologies if this is aggravating.
Anyway, I have more information.
$start_iso is calculated in function apachesolr_search_date_range() -
As it happens the result of this query for my installation is
2009-08-04T10:00:00ZGAP being 1 month, facets are returned for 2009-08-04T10:00:00Z to 2009-09-04T10:00:00Z (and so on).
When $start_iso is passed to apachesolr_date_format_iso_by_gap() for returning link text to display, 2009-09-04T10:00:00Z is turned into:
or 'September 2009', even though the nodes returned by that facet will have creation dates ranging from September 4 10AM to October 4 at 10am.
If the $start_iso was manipulated to 2009-08-1T00:00:00Z (ie the very start of the month in which the first node on the site was created), the date faceting link would be more accurate, and the functionality would work as expected.
Comment #4
pwolanin commentedThis looks like a duplicate to me - please consolidate everything to one issue.
Comment #5
anarchivist commentedMarking as duplicate; please continue discussion on #558036: Date facet rounding bug.
Comment #6
jpmckinney commentedNot duplicate. See #558036-4: Date facet rounding bug for possible patch.
Comment #7
jpmckinney commentedI can't reproduce this. No matter what, $response->facet_counts->facet_dates->created looks like:
That is, if the gap is +1MONTH, the keys are always the first of each month. My MIN created date is 2010-04-20T00:00:04Z, so there is no relation to that.
What version of Solr are you running?
Comment #8
jpmckinney commentedComment #9
jpmckinney commentedNo reply from OP in 7 months.
Comment #10
jpmckinney commented