Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SUM(i.score * t.COUNT) AS score
- 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 node_access na ON na.nid = n.nid
- WHERE n.STATUS = 1
- AND (na.grant_view >= 1
- AND ((na.gid = 0 AND na.realm = 'all')
- OR (na.gid = 1 AND na.realm = 'workflow_access')
- OR (na.gid = 0 AND na.realm = 'workflow_access_owner')))
- AND (i.word = 'sghsfghnsf')
- AND i.TYPE = 'node'
- GROUP BY i.TYPE, i.sid
- HAVING COUNT(*) >= 1
- ORDER BY score DESC LIMIT 0, 1
Advertisement
Add Comment
Please, Sign In to add comment