-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(browsing): add full text search for search3
- Loading branch information
Showing
10 changed files
with
220 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- This file should undo anything in `up.sql` | ||
alter table artists drop column ts; | ||
|
||
alter table albums drop column ts; | ||
|
||
alter table songs drop column ts; | ||
|
||
drop text search configuration usimple; | ||
|
||
drop extension unaccent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- Your SQL goes here | ||
create extension unaccent schema public; | ||
|
||
create text search configuration usimple (copy = simple); | ||
alter text search configuration usimple | ||
alter mapping for hword, hword_part, word with public.unaccent, simple; | ||
|
||
alter table artists | ||
add column ts tsvector not null generated always as (to_tsvector('usimple', name)) stored; | ||
create index artists_ts_idx on artists using gin (ts); | ||
|
||
alter table albums | ||
add column ts tsvector not null generated always as (to_tsvector('usimple', name)) stored; | ||
create index albums_ts_idx on albums using gin (ts); | ||
|
||
alter table songs | ||
add column ts tsvector not null generated always as (to_tsvector('usimple', title)) stored; | ||
create index songs_ts_idx on songs using gin (ts); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.