Changeset View
Changeset View
Standalone View
Standalone View
swh/search/elasticsearch.py
Show First 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | def origin_update(self, documents: Iterable[OriginDict]) -> None: | ||||
actions = [ | actions = [ | ||||
{ | { | ||||
"_op_type": "update", | "_op_type": "update", | ||||
"_id": sha1, | "_id": sha1, | ||||
"_index": write_index, | "_index": write_index, | ||||
"scripted_upsert": True, | "scripted_upsert": True, | ||||
"upsert": {**document, "sha1": sha1,}, | "upsert": {**document, "sha1": sha1,}, | ||||
"retry_on_conflict": 10, | |||||
"script": { | "script": { | ||||
"source": update_script, | "source": update_script, | ||||
"lang": "painless", | "lang": "painless", | ||||
"params": document, | "params": document, | ||||
}, | }, | ||||
} | } | ||||
for (sha1, document) in documents_with_sha1 | for (sha1, document) in documents_with_sha1 | ||||
] | ] | ||||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |