-
Notifications
You must be signed in to change notification settings - Fork 835
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
bulk insert batch requests #3628
bulk insert batch requests #3628
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
||
def gen_data(): | ||
for num, item in enumerate(new_content_part["instance"], start=0): | ||
print(f"bulk inserting item {num}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print the item_request_id
that yielded
def gen_data(): | ||
for num, item in enumerate(new_content_part["instance"], start=0): | ||
print(f"bulk inserting item {num}") | ||
item_body = doc_body.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this redundant?
|
||
yield { | ||
"_index": index_name, | ||
"_type": "_doc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use helper function log_helper.DOC_TYPE_NAME
* bulk insert batch requests * address PR comments
* bulk insert batch requests * address PR comments
What this PR does / why we need it:
The previous implementation does a for loop and inserts each item in a batch request as an individual update to elasticsearch. This PR changes inserting batch requests by using bulk updates. This provides a significant improvement in performance.
Special notes for your reviewer:
Does this PR introduce a user-facing change?: