about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-14T20·10+0200
committerVincent Ambo <github@tazj.in>2018-04-14T20·21+0200
commit06f7f23bab2113ba80f8fa863c8281a585ef822e (patch)
tree41d1b1d524378f3b97263431fe10ef5b99d8ff1d
parent4132869277656437f1f62869a2b1676d4c1c42d7 (diff)
fix(migrations): Change weighting of title vs. body
After thinking for a little while I actually think the body of a post
may be more relevant when searching for posts than the thread title.

Right now this is just a hunch and we'll have to find out how it
actually ends up working in real life.
-rw-r--r--migrations/2018-04-14-170750_search-index/up.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/migrations/2018-04-14-170750_search-index/up.sql b/migrations/2018-04-14-170750_search-index/up.sql
index ed997d3e041b..6b7d90eca63c 100644
--- a/migrations/2018-04-14-170750_search-index/up.sql
+++ b/migrations/2018-04-14-170750_search-index/up.sql
@@ -10,8 +10,8 @@ CREATE MATERIALIZED VIEW search_index AS
          t.id AS thread_id,
          t.title AS title,
          p.body AS body,
-         setweight(to_tsvector('english', t.title), 'A') ||
-         setweight(to_tsvector('english', p.body), 'B') ||
+         setweight(to_tsvector('english', t.title), 'B') ||
+         setweight(to_tsvector('english', p.body), 'A') ||
          setweight(to_tsvector('simple', t.author_name), 'C') ||
          setweight(to_tsvector('simple', p.author_name), 'C') AS document
     FROM posts p