SHOW:
|
|
- or go back to the newest paste.
1 | SELECT | |
2 | - | date, |
2 | + | |
3 | - | pos, |
3 | + | message |
4 | FROM | |
5 | - | message, |
5 | + | ( |
6 | - | ts_headline('russian', message, q, 'HighlightAll = true, StartSel = "", StopSel = ""') AS body |
6 | + | SELECT |
7 | date, | |
8 | - | logs, |
8 | + | pos, |
9 | - | plainto_tsquery('russian', $1) AS q |
9 | + | author, |
10 | - | WHERE |
10 | + | message, |
11 | - | to_tsvector('russian', message) @@ q |
11 | + | ts_headline('russian', message, q, 'HighlightAll = true, StartSel = "", StopSel = ""') AS body |
12 | - | AND NOT author = ANY ($2) |
12 | + | FROM |
13 | logs, | |
14 | - | date ASC, |
14 | + | plainto_tsquery('russian', $1) AS q |
15 | - | pos DESC |
15 | + | WHERE |
16 | - | LIMIT 2000 |
16 | + | to_tsvector('russian', message) @@ q |
17 | AND NOT author = ANY ($2) | |
18 | ORDER BY | |
19 | ts_rank(to_tsvector('russian', message), q) | |
20 | DESC | |
21 | LIMIT 2000 | |
22 | ) AS sq | |
23 | GROUP BY | |
24 | author | |
25 | ORDER BY | |
26 | count(message) | |
27 | LIMIT 5 |