瀏覽代碼

Use inserted_at as sort in search.

tags/v0.9.9
Roger Braun 6 年之前
父節點
當前提交
b7b3e3f263
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      lib/pleroma/web/twitter_api/twitter_api.ex

+ 1
- 1
lib/pleroma/web/twitter_api/twitter_api.ex 查看文件

@@ -213,7 +213,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
where: fragment("to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)", a.data, ^query),
limit: ^limit,
offset: ^offset,
order_by: [desc: :updated_at] # this one isn't indexed so psql won't take the wrong index.
order_by: [desc: :inserted_at] # this one isn't indexed so psql won't take the wrong index.

activities = Repo.all(q)
activities_to_statuses(activities, %{for: user})


Loading…
取消
儲存