#331719 by chx: Fix search query that had a field aliased to one of its column names, causing problems in certain databases.
parent
1632855a9f
commit
7aea369db5
|
@ -948,7 +948,7 @@ function do_search($keywords, $type, $join1 = '', $where1 = '1 = 1', $arguments1
|
|||
}
|
||||
|
||||
// Calculate maximum keyword relevance, to normalize it.
|
||||
$select = "SELECT SUM(i.score * t.count) AS score FROM {search_index} i $join WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d ORDER BY score DESC";
|
||||
$select = "SELECT SUM(i.score * t.count) AS calculated_score FROM {search_index} i $join WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d ORDER BY calculated_score DESC";
|
||||
$arguments = array_merge($arguments1, array($query[4]));
|
||||
$normalize = db_result(db_query_range($select, $arguments, 0, 1));
|
||||
if (!$normalize) {
|
||||
|
|
Loading…
Reference in New Issue