initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I4a6b498153eccd5407510dd541b7f4816a6a6964
This commit is contained in:
commit
6a73d11c4b
124 changed files with 34856 additions and 0 deletions
11
migrations/postgres/V2__fts_indexes.sql
Normal file
11
migrations/postgres/V2__fts_indexes.sql
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
ALTER TABLE media_items ADD COLUMN IF NOT EXISTS search_vector tsvector
|
||||
GENERATED ALWAYS AS (
|
||||
setweight(to_tsvector('english', COALESCE(title, '')), 'A') ||
|
||||
setweight(to_tsvector('english', COALESCE(artist, '')), 'B') ||
|
||||
setweight(to_tsvector('english', COALESCE(album, '')), 'B') ||
|
||||
setweight(to_tsvector('english', COALESCE(genre, '')), 'C') ||
|
||||
setweight(to_tsvector('english', COALESCE(description, '')), 'C') ||
|
||||
setweight(to_tsvector('english', COALESCE(file_name, '')), 'D')
|
||||
) STORED;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_media_search ON media_items USING GIN(search_vector);
|
||||
Loading…
Add table
Add a link
Reference in a new issue