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

Add support for bulk document operations #1864

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

miguelgrinberg
Copy link
Collaborator

@miguelgrinberg miguelgrinberg commented Jul 10, 2024

This change adds Document.bulk and AsyncDocument.bulk. These work similarly to the bulk helper in the low-level client, but the provided generator must return document instances, and the document's clean() method is called before adding to the bulk request.

@miguelgrinberg miguelgrinberg force-pushed the bulk-support branch 2 times, most recently from 8c5b1f0 to e06f0a8 Compare July 10, 2024 16:01
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

elasticsearch_dsl/_async/document.py Outdated Show resolved Hide resolved
elasticsearch_dsl/_async/document.py Outdated Show resolved Hide resolved
@miguelgrinberg miguelgrinberg added the backport 8.x Backport to 8.x label Jul 30, 2024
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
@miguelgrinberg miguelgrinberg merged commit d81786c into elastic:main Jul 30, 2024
16 checks passed
@miguelgrinberg miguelgrinberg deleted the bulk-support branch July 30, 2024 13:09
github-actions bot pushed a commit that referenced this pull request Jul 30, 2024
* Add support for bulk document operations

* Apply suggestions from code review

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

---------

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
(cherry picked from commit d81786c)
miguelgrinberg added a commit that referenced this pull request Jul 30, 2024
* Add support for bulk document operations

* Apply suggestions from code review

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

---------

Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
(cherry picked from commit d81786c)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants