summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/datasources/schema.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/p2pvr/datasources/schema.sql b/p2pvr/datasources/schema.sql
index 3f51014..e19c597 100644
--- a/p2pvr/datasources/schema.sql
+++ b/p2pvr/datasources/schema.sql
@@ -71,8 +71,8 @@ CREATE FUNCTION event_tsvector(e events) RETURNS tsvector
LANGUAGE sql STABLE LEAKPROOF
AS $$
select (setweight(to_tsvector('english', e.title), 'A') ||
- setweight(to_tsvector('english', e.subtitle), 'B') ||
- setweight(to_tsvector('english', e.description), 'C'));
+ setweight(to_tsvector('english', coalesce(e.subtitle, '')), 'B') ||
+ setweight(to_tsvector('english', coalesce(e.description, '')), 'C'));
$$;
@@ -470,7 +470,7 @@ ALTER TABLE ONLY transportstreams
-- Name: idx_event_search; Type: INDEX; Schema: public; Owner: gentoo; Tablespace:
--
-CREATE INDEX idx_event_search ON events USING gin ((((setweight(to_tsvector('english'::regconfig, title), 'A'::"char") || setweight(to_tsvector('english'::regconfig, subtitle), 'B'::"char")) || setweight(to_tsvector('english'::regconfig, description), 'C'::"char"))));
+CREATE INDEX idx_event_search ON events USING gin ((((setweight(to_tsvector('english'::regconfig, title), 'A'::"char") || setweight(to_tsvector('english'::regconfig, COALESCE(subtitle, ''::text)), 'B'::"char")) || setweight(to_tsvector('english'::regconfig, COALESCE(description, ''::text)), 'C'::"char"))));
--