Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- author,
- message
- FROM
- (
- SELECT
- date,
- pos,
- author,
- message,
- ts_headline('russian', message, q, 'HighlightAll = true, StartSel = "", StopSel = ""') AS body
- FROM
- logs,
- plainto_tsquery('russian', $1) AS q
- WHERE
- to_tsvector('russian', message) @@ q
- AND NOT author = ANY ($2)
- ORDER BY
- ts_rank(to_tsvector('russian', message), q)
- DESC
- LIMIT 2000
- ) AS sq
- GROUP BY
- author
- ORDER BY
- count(message)
- LIMIT 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement