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.
Comment | File | Size | Author |
---|---|---|---|
drupal-head-search.diff | 1.31 KB | Cvbge | |
Comments
Comment #1
Cvbge CreditAttribution: Cvbge commentedChanging to assigned to me.
Comment #2
Steven CreditAttribution: Steven commentedCommitted to HEAD.
Comment #3
(not verified) CreditAttribution: commented