I get following errors:

warning: pg_query(): Query failed: ERROR: column "matches" does not exist in /var/www/dt/d/includes/database.pgsql.inc on line 78.

user error:
query: CREATE TEMPORARY TABLE temp_search_sids AS SELECT i.type, i.sid, SUM(i.score * t.count) AS relevance, COUNT(*) AS matches FROM search_index i INNER JOIN search_total t ON i.word = t.word INNER JOIN node n ON n.nid = i.sid INNER JOIN users u ON n.uid = u.uid WHERE n.status = 1 AND (i.word = 'peter') AND i.type = 'node' GROUP BY i.type, i.sid HAVING matches >= 1 in /var/www/dt/d/includes/database.pgsql.inc on line 95.

The problem is that column aliases (COUNT(*) AS matches) are done after HAVING. The fix is no to use aliases in HAVING.
I've checked that it also works in mysql.

CommentFileSizeAuthor
drupal-head-search.diff1.31 KBCvbge
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Cvbge’s picture

Assigned: Unassigned »

Changing to assigned to me.

Steven’s picture

Status: Needs review » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)