aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-09-16 14:51:55 +0200
committerRoger Braun <roger@rogerbraun.net>2017-09-16 14:51:55 +0200
commit03952a27600b0947c415a72655262eaa37804d23 (patch)
tree84dbb1ebaca20ba94cd14cf72b3affaef197f65a /lib
parentf039c9c19a95e414a641c5209e11b946d939dcfc (diff)
downloadpleroma-03952a27600b0947c415a72655262eaa37804d23.tar.gz
Sort by updated_at
the updated_at column isn't indexed, so postgres won't take the wrong index.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex
index c1a3c887c..69287b9fb 100644
--- a/lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api.ex
@@ -212,7 +212,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
where: fragment("?->>'type' = 'Create'", a.data),
where: fragment("to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)", a.data, ^query),
limit: ^limit,
- offset: ^offset
+ offset: ^offset,
+ order_by: [desc: :updated_at] # this one isn't indexed so psql won't take the wrong index.
activities = Repo.all(q)
activities_to_statuses(activities, %{for: user})