write async update bulk
This commit is contained in:
@@ -107,6 +107,27 @@ class ElasticHelper:
|
||||
raise_on_error=True,
|
||||
raise_on_exception=True,
|
||||
)
|
||||
except BulkIndexError as e:
|
||||
for err in e.errors:
|
||||
print(err)
|
||||
|
||||
|
||||
async def updateBulkList(self, listData, index_name, streem_state=False):
|
||||
chunk_size = 100000
|
||||
raise_on_error = False
|
||||
raise_on_exception = False
|
||||
stats_only = True
|
||||
yield_ok = False
|
||||
try:
|
||||
await async_bulk(
|
||||
client=self.es,
|
||||
actions=self.data_pars(listData, index_name),
|
||||
raise_on_error=raise_on_error,
|
||||
raise_on_exception=raise_on_exception,
|
||||
yield_ok=yield_ok,
|
||||
chunk_size = chunk_size,
|
||||
stats_only=stats_only
|
||||
)
|
||||
except BulkIndexError as e:
|
||||
for err in e.errors:
|
||||
print(err)
|
||||
Reference in New Issue
Block a user