diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-14 19:19:46 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-14 19:19:46 +0000 |
commit | 2e2f8dd8a943d9c3c0fcc873c2ca0541866cf251 (patch) | |
tree | 12022f8ce85005e186302180d2000e7286944d49 /modules | |
parent | adb03ebe78c83c511fb440d0efe2173a04a77965 (diff) | |
download | brdo-2e2f8dd8a943d9c3c0fcc873c2ca0541866cf251.tar.gz brdo-2e2f8dd8a943d9c3c0fcc873c2ca0541866cf251.tar.bz2 |
#199439 by douggreen: fix content search in PostgreSQL
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node/node.module | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 661a0c608..2e331c471 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1185,7 +1185,7 @@ function node_search($op = 'search', $keys = NULL) { } if ($weight = (int)variable_get('node_rank_recent', 5)) { // Exponential decay with half-life of 6 months, starting at last indexed node - $ranking[] = '%d * POW(2, (GREATEST(n.created, n.changed, c.last_comment_timestamp) - %d) * 6.43e-8)'; + $ranking[] = '%d * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp)) - %d) * 6.43e-8)'; $arguments2[] = $weight; $arguments2[] = (int)variable_get('node_cron_last', 0); $join2 .= ' LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid'; @@ -1195,7 +1195,7 @@ function node_search($op = 'search', $keys = NULL) { if (module_exists('comment') && $weight = (int)variable_get('node_rank_comments', 5)) { // Inverse law that maps the highest reply count on the site to 1 and 0 to 0. $scale = variable_get('node_cron_comments_scale', 0.0); - $ranking[] = '%d * (2.0 - 2.0 / (1.0 + c.comment_count * %f))'; + $ranking[] = '%d * (2.0 - 2.0 / (1.0 + MAX(c.comment_count) * %f))'; $arguments2[] = $weight; $arguments2[] = $scale; if (!$stats_join) { @@ -1207,7 +1207,7 @@ function node_search($op = 'search', $keys = NULL) { $weight = (int)variable_get('node_rank_views', 5)) { // Inverse law that maps the highest view count on the site to 1 and 0 to 0. $scale = variable_get('node_cron_views_scale', 0.0); - $ranking[] = '%d * (2.0 - 2.0 / (1.0 + nc.totalcount * %f))'; + $ranking[] = '%d * (2.0 - 2.0 / (1.0 + MAX(nc.totalcount) * %f))'; $arguments2[] = $weight; $arguments2[] = $scale; $join2 .= ' LEFT JOIN {node_counter} nc ON nc.nid = i.sid'; |