write async update bulk

This commit is contained in:
sisrsis
2026-07-02 14:09:12 +03:30
parent 63a2193b07
commit a578a26e07
2 changed files with 478 additions and 7 deletions
+21
View File
@@ -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)