[#477] Added FTS index for users. Fixed failing test.
This commit is contained in:
parent
dc45ec62c2
commit
fc965f982c
2 changed files with 22 additions and 5 deletions
|
|
@ -0,0 +1,17 @@
|
|||
defmodule Pleroma.Repo.Migrations.CreateUserFtsIndex do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create index(
|
||||
:users,
|
||||
[
|
||||
"""
|
||||
(setweight(to_tsvector('simple', regexp_replace(nickname, '\\W', ' ', 'g')), 'A') ||
|
||||
setweight(to_tsvector('simple', regexp_replace(coalesce(name, ''), '\\W', ' ', 'g')), 'B'))
|
||||
"""
|
||||
],
|
||||
name: :users_fts_index,
|
||||
using: :gin
|
||||
)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue