Closed (fixed)
Project:
Xapian integration
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2008 at 12:00 UTC
Updated:
8 Jul 2008 at 15:12 UTC
Now xapian is indexing, and search is working, I'm getting a lot of division by zero errors in node_search:
This is the relevant bit of code:
$results[] = array('link' => url('node/'. $item->sid, NULL, NULL, TRUE),
'type' => node_get_types('name', $node),
'title' => $node->title,
'user' => theme('username', $node),
'date' => $node->changed,
'node' => $node,
'extra' => $extra,
'score' => $item->score / $total,
'snippet' => search_excerpt($keys, $node->body));
Marking as active needs more info until I can track down steps to reproduce.
Comments
Comment #1
jeremy commentedWhen do you see these errors? Where do they show up? (In the watchdog log? On the screen?)
Comment #2
catchSorry, forgot to follow up on this one.
Errors are in watchdog.
The division by zero happens when all node scoring factors are set to 0 - so it just needs to check for that condition (ref: http://acquia.com/blog/drupals-search-compared-google-and-yahoo for how core handles this and why I did it in the first place).
Comment #3
jeremy commentedWhat is the complete error message?
Comment #4
catchDivision by zero in modules/node/node.module on line 948.
Comment #5
jeremy commentedIf you disable the xapian module, does the error go away? Offhand, it seems unlikely that the xapian module is responsible for the error you're seeing, as it's not using core's weighting methods.
Comment #6
catchYep, same issue without xapian enabled. Sorry. Idiotic bug report.
Comment #7
catchCore bug here for reference: http://drupal.org/node/252580 Looks like it never made it into D5.