re-add fetching by url
[akkoma] / lib / pleroma / elasticsearch / store.ex
index 93501a2fb7ad4f7b6c3fcfd06a3c592fc32b5f3c..caa49cbeacc1bbf6b739f7044b6a7d62772be151 100644 (file)
@@ -141,6 +141,8 @@ defmodule Pleroma.Elasticsearch do
 
   def bulk_post(_, :hashtags), do: {:ok, nil}
 
+  def search(_, _, _, :skip), do: []
+
   def search(:raw, index, type, q) do
     with {:ok, raw_results} <- Elastix.Search.search(url(), index, [type], q) do
       results =
@@ -162,6 +164,7 @@ defmodule Pleroma.Elasticsearch do
       results
       |> Enum.map(fn result -> result["_id"] end)
       |> Pleroma.Activity.all_by_ids_with_object()
+      |> Enum.sort(&(&1.inserted_at >= &2.inserted_at))
     else
       e ->
         Logger.error(e)