From 73bdfd6c2b92533b5d48c2801a8e6548e8a2551a Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 16 Sep 2017 10:50:43 +0200 Subject: [PATCH] Set search config to 'english'. --- lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 6b84d732f..fcc87d414 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -289,13 +289,13 @@ def unfollow(%{assigns: %{user: follower}} = conn, %{"id" => id}) do def search(%{assigns: %{user: user}} = conn, %{"q" => query}) do q = from u in User, - where: fragment("(to_tsvector(?) || to_tsvector(?)) @@ plainto_tsquery(?)", u.nickname, u.name, ^query), + where: fragment("(to_tsvector('english', ?) || to_tsvector('english', ?)) @@ plainto_tsquery('english', ?)", u.nickname, u.name, ^query), limit: 20 accounts = Repo.all(q) q = from a in Activity, where: fragment("?->>'type' = 'Create'", a.data), - where: fragment("to_tsvector(?->'object'->>'content') @@ plainto_tsquery(?)", a.data, ^query), + where: fragment("to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)", a.data, ^query), limit: 20 statuses = Repo.all(q)