Skip to content

Commit

Permalink
Merge branch 'MP-1840-reduce-elasticsearch-bulk-load' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Jan 8, 2025
2 parents 13ce1be + 80727ff commit ab3741d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions deployer/src/deployer/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import Counter

import click
from elasticsearch.helpers import parallel_bulk
from elasticsearch.helpers import streaming_bulk
from elasticsearch_dsl import Index
from elasticsearch_dsl.connections import connections
from selectolax.parser import HTMLParser
Expand Down Expand Up @@ -90,10 +90,9 @@ def get_progressbar():
errors_counter = Counter()
t0 = time.time()
with get_progressbar() as bar:
for success, info in parallel_bulk(
for success, info in streaming_bulk(
connection,
generator(),
thread_count=1,
# If the bulk indexing failed, it will by default raise a BulkIndexError.
# Setting this to 'False' will suppress that.
raise_on_exception=False,
Expand Down

0 comments on commit ab3741d

Please sign in to comment.