mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-29 16:56:52 +00:00
merge
This commit is contained in:
parent
cc4c5f22f4
commit
9d5d964bf8
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
defmodule Mix.Tasks.Pleroma.Activity do
|
defmodule Mix.Tasks.Pleroma.Activity do
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Activity.Search
|
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
alias Pleroma.Pagination
|
alias Pleroma.Pagination
|
||||||
|
|
|
@ -46,20 +46,25 @@ defmodule Pleroma.Elasticsearch do
|
||||||
end
|
end
|
||||||
|
|
||||||
def put(%Activity{} = activity) do
|
def put(%Activity{} = activity) do
|
||||||
{:ok, _} = Elastix.Document.index(
|
{:ok, _} =
|
||||||
|
Elastix.Document.index(
|
||||||
url(),
|
url(),
|
||||||
"activities",
|
"activities",
|
||||||
"activity",
|
"activity",
|
||||||
DocumentMappings.Activity.id(activity),
|
DocumentMappings.Activity.id(activity),
|
||||||
DocumentMappings.Activity.encode(activity)
|
DocumentMappings.Activity.encode(activity)
|
||||||
)
|
)
|
||||||
{:ok, _} = bulk_post(
|
|
||||||
activity.object.hashtags, :hashtags
|
{:ok, _} =
|
||||||
|
bulk_post(
|
||||||
|
activity.object.hashtags,
|
||||||
|
:hashtags
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def put(%User{} = user) do
|
def put(%User{} = user) do
|
||||||
{:ok, _ } = Elastix.Document.index(
|
{:ok, _} =
|
||||||
|
Elastix.Document.index(
|
||||||
url(),
|
url(),
|
||||||
"users",
|
"users",
|
||||||
"user",
|
"user",
|
||||||
|
@ -87,7 +92,8 @@ defmodule Pleroma.Elasticsearch do
|
||||||
end)
|
end)
|
||||||
|> List.flatten()
|
|> List.flatten()
|
||||||
|
|
||||||
{:ok, %{body: %{"errors" => false}}} = Elastix.Bulk.post(
|
{:ok, %{body: %{"errors" => false}}} =
|
||||||
|
Elastix.Bulk.post(
|
||||||
url(),
|
url(),
|
||||||
d,
|
d,
|
||||||
index: "activities",
|
index: "activities",
|
||||||
|
|
|
@ -3,7 +3,7 @@ defmodule Pleroma.Search.Elasticsearch.Parsers.Hashtag do
|
||||||
%{
|
%{
|
||||||
term: %{
|
term: %{
|
||||||
hashtag: %{
|
hashtag: %{
|
||||||
value: String.downcase(term),
|
value: String.downcase(term)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue