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 indexing #5

Closed
mrdziuban opened this issue Feb 9, 2016 · 3 comments
Closed

Support for bulk indexing #5

mrdziuban opened this issue Feb 9, 2016 · 3 comments

Comments

@mrdziuban
Copy link

Would it be possible to add support for bulk indexing documents, as described in the Elasticsearch Bulk API docs? Thanks in advance!

@werbitzky
Copy link
Owner

yes, actually that should be pretty easy, I will add support as soon as I find time. :)

for now consider the following workaround:

    payload = create_bulk_payload(ordered_indexes)

    elastic_url = ShopApi.config :elastic_url
    index_name = ShopApi.config :elastic_index_name

    url = "#{elastic_url}/#{index_name}/_bulk"

    Elastix.HTTP.post(url, payload)

where payload would be a concatenated string of json indexing payloads, in between and ending with an \n

the final line of data must end with a newline character \n.

@mrdziuban
Copy link
Author

Awesome, thanks--that worked great! Feel free to close this if you want, or keep it open until the support is added

@werbitzky
Copy link
Owner

Closed thanks to @FabienHenon #23

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

2 participants