From 7aea369db5de39ab1cc19c299dba61524c22d25f Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 8 Nov 2008 04:55:13 +0000 Subject: #331719 by chx: Fix search query that had a field aliased to one of its column names, causing problems in certain databases. --- modules/search/search.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/search/search.module b/modules/search/search.module index c96dfbfa7..627983476 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -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) { -- cgit v1.2.3