I have the following filters

search keyword | node type | Taxonomy Term 1 (tql_filter)

When I run a search, I am getting this error

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid) = search_index.sid WHERE (node.status = '1') AND (node.type I' at line 1 query: SELECT count(DISTINCT(node.nid)) FROM node node LEFT JOIN search_index search_index ON DISTINCT(node.nid) = search_index.sid WHERE (node.status = '1') AND (node.type IN ('entertainment','health','restaurant','service','shop','spiritual','website')) AND ((search_index.word='test')) AND (node.nid in (SELECT * FROM (SELECT DISTINCT nid FROM `term_node` WHERE tid in (13)) AS finalTable)) in /home/local/public_html/beta/includes/database.mysql.inc on line 174.

Could you please explain what might be causing this

Comments

roychri’s picture

Status: Active » Closed (works as designed)

The problem is not with TQL and not with VIEWS.
This is a core issue.
Here are reference to your issue:
#141802: SQL syntax error with Node: Distinct
#130242: db_distinct_field produces MySQL errors

If you search on google for "db_distinct_field syntax" you might for information on this issue.