$normalize = db_result(db_query_range($select, $arguments, 0, 1)); the field name is irrevelant and it's not clear whether ORDER BY score is the DB column or the aliased columns. Yes works in MySQL and pgsql but not in sqlite and then if it does not matter for my/pg why not fix it?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | score_result.patch | 2.93 KB | chx |
| #6 | score_result.patch | 3.52 KB | chx |
| search_query_fix.patch | 802 bytes | chx |
Comments
Comment #1
mlncn commentedTested on MySQL, Drupal 7. Everything continues to work as before.
Comment #2
drewish commentedsounds like a simple enough fix. verified that the search tests pass on mysql 5.1.
Comment #3
webchickThanks for the reviews all. :)
Committed to HEAD. Thanks!
Comment #4
damien tournoud commentedHum.
In the "get the total score to normalize it" query, the "ORDER BY score" has no purpose at all, we might as well drop it.
The true issue is below, in the query:
$select is made in part from $column2 that default to "i.relevance AS score" and from $sort_parameters that default to "ORDER BY score DESC".
Comment #5
damien tournoud commentedComment #6
chx commentedThis patch changes every score result to
score_resultand all tests pass.Comment #7
webchickcalculated_score seems a better alias than score_result, which is rather ambiguous. According to #drupal, DamZ agrees. :)
Comment #8
chx commentedWe could call it dancing_blue_elepehants for all I care.
Comment #9
webchickThanks, committed! :)