Skip to content

Commit

Permalink
Fix bulk indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
cstar committed Aug 1, 2013
1 parent 5f50af3 commit dec48d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/erlastic_search.erl
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ bulk_index_docs(Params, IndexTypeIdJsonTuples) ->
[Header, <<"\n">>, Doc, <<"\n">>];
({Index, Type, Id, Doc}) when is_list(Doc) ->
Header = jsx:encode([
{<<"index">>, [{[
{<<"index">>, [
{<<"_index">>, Index},
{<<"_type">>, Type},
{<<"_id">>, Id}
]}]}]),
]}]),
[Header, <<"\n">>, jsx:encode(Doc), <<"\n">>]
end, IndexTypeIdJsonTuples),
erls_resource:post(Params, <<"/_bulk">>, [], [], Body, []).
erls_resource:post(Params, <<"/_bulk">>, [], [], iolist_to_binary(Body), []).


%%--------------------------------------------------------------------
Expand Down

0 comments on commit dec48d3

Please sign in to comment.