Merge search behaviour change, and refactor elasticsearch #28

Merged
floatingghost merged 91 commits from elasticsearch-refactor into develop 2022-06-30 16:55:31 +00:00
Showing only changes of commit 7b3701e6b9 - Show all commits

View file

@ -18,7 +18,7 @@ def run(["index"]) do
Pleroma.HTTP.post(
"#{endpoint}/indexes/objects/settings/ranking-rules",
Jason.encode!([
"desc(id)",
"desc(published)",
"typo",
"words",
"proximity",
@ -54,7 +54,15 @@ def run(["index"]) do
|> Stream.map(fn objects ->
Enum.map(objects, fn object ->
data = object.data
%{id: object.id, source: data["source"], ap: data["id"]}
{:ok, published, _} = DateTime.from_iso8601(data["published"])
%{
id: object.id,
source: data["source"],
ap: data["id"],
published: published |> DateTime.to_unix()
}
end)
end)
|> Stream.each(fn objects ->