diff options
author | lain <lain@soykaf.club> | 2019-05-03 19:15:55 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-05-03 19:21:09 +0200 |
commit | 0e37fddd5abad5db0378c8186513fbba0fbd6586 (patch) | |
tree | c8686719caad35716b39ddb559ac4a13fa2f2f4c /priv | |
parent | 027ded0df799266d74d9680bd7ef24450efc910f (diff) | |
download | pleroma-0e37fddd5abad5db0378c8186513fbba0fbd6586.tar.gz pleroma-0e37fddd5abad5db0378c8186513fbba0fbd6586.zip |
Search: Add fts index on objects table.
Diffstat (limited to 'priv')
-rw-r--r-- | priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs b/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs new file mode 100644 index 000000000..9b274695e --- /dev/null +++ b/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs @@ -0,0 +1,8 @@ +defmodule Pleroma.Repo.Migrations.AddFTSIndexToObjects do + use Ecto.Migration + + def change do + drop_if_exists index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"], using: :gin, name: :activities_fts) + create index(:objects, ["(to_tsvector('english', data->>'content'))"], using: :gin, name: :objects_fts) + end +end |