about summary refs log tree commit diff
path: root/dist
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-11-16 21:01:07 -0600
committermultiple creatures <dev@multiple-creature.party>2019-11-16 21:01:07 -0600
commit1132af15151713f52d8d1e320271185865a79633 (patch)
treec7d5dd6afb7a60c840a0d3238124f01c747eada8 /dist
parent487c945d160e9349579bf541147c949f8bca3c46 (diff)
Moved to using a normalized text column for searches. Admins using an FTS-enabled version of Monsterfork will need to apply the migration from `dist/search.sql` then run `bundle exec rails monsterfork:index_statuses`.
Diffstat (limited to 'dist')
-rw-r--r--dist/search.sql8
1 files changed, 6 insertions, 2 deletions
diff --git a/dist/search.sql b/dist/search.sql
index eef191e60..e68b3c9b3 100644
--- a/dist/search.sql
+++ b/dist/search.sql
@@ -12,7 +12,11 @@ DROP TRIGGER IF EXISTS tsvectorupdate ON statuses;
 DROP FUNCTION IF EXISTS tsv_update_trigger;
 DROP INDEX IF EXISTS tsv_idx;
 ALTER TABLE statuses DROP COLUMN IF EXISTS tsv;
+DROP INDEX IF EXISTS index_statuses_on_text_trgm;
+DROP INDEX IF EXISTS index_statuses_on_spoiler_text_trgm;
 
 -- Create new trigram indexes --
-CREATE INDEX CONCURRENTLY IF NOT EXISTS index_statuses_on_text_trgm ON statuses USING GIN (text gin_trgm_ops);
-CREATE INDEX CONCURRENTLY IF NOT EXISTS index_statuses_on_spoiler_text_trgm ON statuses USING GIN (spoiler_text gin_trgm_ops);
+CREATE INDEX CONCURRENTLY IF NOT EXISTS index_statuses_on_normalized_text_trgm ON statuses USING GIN (normalized_text gin_trgm_ops);
+
+-- Compact tables ---
+VACUUM ANALYZE;