wiki pages: change tsvector update trigger to not use test_parser.
Change the wiki_pages tsvector_update_trigger to use `pg_catalog.english` instead of `public.danbooru`. This changes how wiki page text is parsed for full-text search to use the standard English parser instead of test_parser. This is to prepare for dropping test_parser. Using test_parser here was wrong anyway because it meant that punctuation wasn't removed from words when indexing wiki pages for full-text search.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class ChangeTsVectorTriggerOnWikiPages < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
execute("DROP TRIGGER trigger_wiki_pages_on_update ON wiki_pages")
|
||||
execute("CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON public.wiki_pages FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'pg_catalog.english', 'body', 'title')")
|
||||
end
|
||||
|
||||
def down
|
||||
execute("DROP TRIGGER trigger_wiki_pages_on_update ON wiki_pages")
|
||||
execute("CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON public.wiki_pages FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('body_index', 'public.danbooru', 'body', 'title')")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user