X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fmastodon_api_controller.ex;h=fcc87d414543d7e42ca895ac2a6755965388da95;hb=73bdfd6c2b92533b5d48c2801a8e6548e8a2551a;hp=6b84d732faac147f56e34cb06bd26f4c6905a7b3;hpb=9f0a2a714b498edfbacc638fa79e06e3a8dc4d04;p=akkoma 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 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController 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)