SHOW:
|
|
- or go back to the newest paste.
| 1 | SELECT SUM(i.score * t.count) AS score | |
| 2 | - | FROM search_index i |
| 2 | + | FROM search_index i |
| 3 | - | INNER JOIN search_total t ON i.word = t.word |
| 3 | + | INNER JOIN search_total t ON i.word = t.word |
| 4 | - | INNER JOIN node n ON n.nid = i.sid |
| 4 | + | INNER JOIN node n ON n.nid = i.sid |
| 5 | - | INNER JOIN node_access na ON na.nid = n.nid |
| 5 | + | INNER JOIN node_access na ON na.nid = n.nid |
| 6 | WHERE n.status = 1 | |
| 7 | - | AND (na.grant_view >= 1 |
| 7 | + | AND (na.grant_view >= 1 |
| 8 | - | AND ((na.gid = 0 AND na.realm = 'all') |
| 8 | + | AND ((na.gid = 0 AND na.realm = 'all') |
| 9 | - | OR (na.gid = 1 AND na.realm = 'workflow_access') |
| 9 | + | OR (na.gid = 1 AND na.realm = 'workflow_access') |
| 10 | - | OR (na.gid = 0 AND na.realm = 'workflow_access_owner'))) |
| 10 | + | OR (na.gid = 0 AND na.realm = 'workflow_access_owner'))) |
| 11 | - | AND (i.word = 'sghsfghnsf') |
| 11 | + | AND (i.word = 'sghsfghnsf') |
| 12 | - | AND i.type = 'node' |
| 12 | + | AND i.type = 'node' |
| 13 | GROUP BY i.type, i.sid | |
| 14 | HAVING COUNT(*) >= 1 | |
| 15 | ORDER BY score DESC LIMIT 0, 1 |