We have problem with report "Top search phrases with no results" (no results).
In this code (in apachesolr_stats_generate_report_elements):
// Count keywords with zero results; but only when no filters issued.
if ($record->numfound == 0 && (!$record->filters)) {
@$keywords_noresults[$keys_filtered]++;
}
variable $record->filters is set to 'a:0:{}'. May code should look like this:
// Count keywords with zero results; but only when no filters issued.
if ($record->numfound == 0 && (!$record->filters || $record->filters == 'a:0:{}')) {
@$keywords_noresults[$keys_filtered]++;
}
Comments
Comment #1
cpliakas commentedInstead of testing for the string, it might be useful to unserialize the array since it is already done in that loop once. We could unserialize it at the top of the loop, store it in a variable, and then use the variable in both places.
Comment #2
cpliakas commentedThe attached patch unserializes the filters at the top and stores them in a variable for reuse.
Comment #3
janusman commentedThis looks good. I'm a bit busy moving to boston this next week but I think I can probably take a better look at this soon.
Comment #4
cpliakas commentedUnderstood. Welcome to the area! I have lived outside of Boston most of my life, so maybe I will see you around at a local Drupal event sometime.
Good luck with the move,
Chris
Comment #5
cpliakas commentedResolved in commit http://drupalcode.org/project/apachesolr_stats.git/commit/7502d9f.
Comment #6
janusman commentedI think this actually needs backporting =)