Fixes search query syntax

mad about the lack of django docs on this, jeez
This commit is contained in:
Mouse Reeve
2021-06-26 16:20:18 -07:00
parent 789f823d5d
commit 6470033ac9
3 changed files with 5 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class Migration(migrations.Migration):
setweight(to_tsvector('simple', coalesce(new.title, '')), 'A')
) ||
setweight(to_tsvector('english', coalesce(new.subtitle, '')), 'B') ||
(SELECT setweight(to_tsvector('simple', coalesce(array_to_string(array_agg(bookwyrm_author.name), ' '), '')), 'B')
(SELECT setweight(to_tsvector('simple', coalesce(array_to_string(array_agg(bookwyrm_author.name), ' '), '')), 'C')
FROM bookwyrm_book
LEFT OUTER JOIN bookwyrm_book_authors
ON bookwyrm_book.id = bookwyrm_book_authors.book_id