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");

Comments

Niklas Fiekas’s picture

Status: Active » Fixed

Fixed in 7.x-1.x. Also see #257916: Improve performance of search totals calculation for some more problems with LOG10 and GREATEST.

Edit: And comitted to 6.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

waliod’s picture

Issue summary: View changes

how to add /modify/ create tables to drupal's 7, databases