not working on Postgress

mscalone - October 23, 2009 - 15:00
Project:Reindex
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

There is a query doesn't work on postgres:

db_query("INSERT INTO {search_total} (word, count) SELECT word, LOG10(1+1/GREATEST(1, SUM(score))) FROM {search_index} GROUP BY word");

the log function is specific for mysql.. you sould use this on postgress

db_query("INSERT INTO {search_total} (word, count) SELECT word, LOG(10, CAST(1+1/GREATEST(1, SUM(score)) as numeric)) FROM {search_index} GROUP BY word");

 
 

Drupal is a registered trademark of Dries Buytaert.