Search: Use RUM index.

This commit is contained in:
lain 2019-05-11 11:26:46 +02:00
commit 01c45ddc9e
2 changed files with 36 additions and 3 deletions

View file

@ -1019,12 +1019,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients,
where:
fragment(
"to_tsvector('english', ?->>'content') @@ plainto_tsquery('english', ?)",
o.data,
"? @@ plainto_tsquery('english', ?)",
o.fts_content,
^query
),
limit: 20,
order_by: [desc: :id]
order_by: [fragment("? <=> now()::date", o.inserted_at)]
)
Repo.all(q) ++ fetched