end
def put(%Activity{} = activity) do
- {:ok, _} = Elastix.Document.index(
- url(),
- "activities",
- "activity",
- DocumentMappings.Activity.id(activity),
- DocumentMappings.Activity.encode(activity)
- )
- {:ok, _} = bulk_post(
- activity.object.hashtags, :hashtags
- )
+ {:ok, _} =
+ Elastix.Document.index(
+ url(),
+ "activities",
+ "activity",
+ DocumentMappings.Activity.id(activity),
+ DocumentMappings.Activity.encode(activity)
+ )
+
+ {:ok, _} =
+ bulk_post(
+ activity.object.hashtags,
+ :hashtags
+ )
end
def put(%User{} = user) do
- {:ok, _ } = Elastix.Document.index(
- url(),
- "users",
- "user",
- DocumentMappings.User.id(user),
- DocumentMappings.User.encode(user)
- )
+ {:ok, _} =
+ Elastix.Document.index(
+ url(),
+ "users",
+ "user",
+ DocumentMappings.User.id(user),
+ DocumentMappings.User.encode(user)
+ )
end
def bulk_post(data, :activities) do
end)
|> List.flatten()
- {:ok, %{body: %{"errors" => false}}} = Elastix.Bulk.post(
- url(),
- d,
- index: "activities",
- type: "activity"
- )
+ {:ok, %{body: %{"errors" => false}}} =
+ Elastix.Bulk.post(
+ url(),
+ d,
+ index: "activities",
+ type: "activity"
+ )
end
def bulk_post(data, :users) do