Closed (fixed)
Project:
Drupal core
Version:
6.0-rc1
Component:
search.module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
3 Jan 2008 at 02:16 UTC
Updated:
18 Jan 2008 at 13:11 UTC
The simpletest's written by Steven for the search module (see #205631) uncovered a bug in the search results normalization where the wrong value was being used to normalize the results. This patch fixes that.
| Comment | File | Size | Author |
|---|---|---|---|
| 205631.patch | 1018 bytes | douggreen |
Comments
Comment #1
chx commentedI won't pretend that I understand any of these but as it causes 13 more tests to pass it surely is good.
Comment #2
gábor hojtsyLooks logical. Committed.
Comment #3
scroogie commentedPerhaps the comment above the normalization query should be adjusted, because it currently says
// Calculate maximum keyword relevance, to normalize it.
although after this patch it effectively calculates the sum of all keyword relevances and normalizes with that value instead of the highest relevance, meaning that the highest relevance is now not always 1.0.
Comment #4
douggreen commentedYes, it calculates uses the SQL SUM() function here when calculating the normalization scale , but it also uses the SQL SUM() function on line 1285 to calculate the actual value. So, I think that the highest relevance is still always 1.0.
The new serach simple tests (see #205631) make sure that the returned relevancies are always in the range 0 to 1, and the patched code now passes all of those tests. Do you have a test case that shows differently?
Comment #5
scroogie commentedI didn't mean it's flawed. Originally I just wanted to point out that the comment needs updating. You are right, the highest relevance will still be 1.0, I just missed the ORDER BY clause first.
Comment #6
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.