Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bulk update, please ? #63

Open
arkanmgerges opened this issue Aug 23, 2017 · 1 comment
Open

Support for bulk update, please ? #63

arkanmgerges opened this issue Aug 23, 2017 · 1 comment

Comments

@arkanmgerges
Copy link

Hi, can you make the app to bulk update the documents please ? instead of sending a lot of requests to update the document, it would be nice to have bulk update.

Thanks

@ghost
Copy link

ghost commented Oct 6, 2018

Looking at the common tests - this appears to be implemented via erlastic_search:bulk_index_docs/2 :

bulk_index_id(Config) ->
IndexName = ?config(index_name, Config),
Id = create_random_name(<<"es_id_">>),
Doc = {<<"how">>, <<"you_doing">>}, %% in Joey Tribbiani voice
Items = [{IndexName, <<"type_1">>, Id, [Doc]}],
{ok, _} = erlastic_search:bulk_index_docs(#erls_params{}, Items),
{ok, _} = erlastic_search:flush_index(IndexName),
{ok, Resp} = erlastic_search:search(IndexName, <<"how:you_doing">>),
{<<"hits">>, Hits} = lists:keyfind(<<"hits">>, 1, Resp),
{<<"hits">>, Hits1} = lists:keyfind(<<"hits">>, 1, Hits),
F = fun(Item) ->
{<<"_id">>, AId} = lists:keyfind(<<"_id">>, 1, Item),
AId == Id
end,
[_] = lists:filter(F, Hits1).

Let me know if this is still an issue - if I don't hear back from you, I'll close this issue out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant