summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/sql/SI_eventSearch.sql
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/daemon/sql/SI_eventSearch.sql')
-rw-r--r--p2pvr/daemon/sql/SI_eventSearch.sql5
1 files changed, 4 insertions, 1 deletions
diff --git a/p2pvr/daemon/sql/SI_eventSearch.sql b/p2pvr/daemon/sql/SI_eventSearch.sql
index 7ff0cf7..ffbe93f 100644
--- a/p2pvr/daemon/sql/SI_eventSearch.sql
+++ b/p2pvr/daemon/sql/SI_eventSearch.sql
@@ -22,11 +22,14 @@ select
e.episodes,
e.year,
e.flags,
- e.season
+ e.season,
+ e.eventuid,
+ e.current
from events e
where tsrange(?, ?, '[)') && tsrange(e.starttime, e.stoptime)
and (e.serviceId = ? or ?::int is null)
and (event_tsvector(e) @@ plainto_tsquery(?) or ?::text is null)
+and current
order by
max(ts_rank(event_tsvector(e), plainto_tsquery(?))) over(partition by title) desc,
max(ts_rank(event_tsvector(e), plainto_tsquery(?))) over(partition by title, subtitle, description) desc,