aboutsummaryrefslogtreecommitdiffstats
path: root/db/schema_0074-add-users-full-text-search-index.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/schema_0074-add-users-full-text-search-index.sql')
-rw-r--r--db/schema_0074-add-users-full-text-search-index.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/db/schema_0074-add-users-full-text-search-index.sql b/db/schema_0074-add-users-full-text-search-index.sql
new file mode 100644
index 000000000..dc743bd47
--- /dev/null
+++ b/db/schema_0074-add-users-full-text-search-index.sql
@@ -0,0 +1,6 @@
+CREATE INDEX CONCURRENTLY users_fulltext_idx on users USING GIN(
+ to_tsvector(
+ 'DB_FULL_TEXT_SEARCH_CONFIG',
+ translate(id || ' ' || coalesce(name,'') || ' ' || coalesce(email,'') || ' ' || coalesce(phone,''), '@.', ' ')
+ )
+);