mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-02 00:25:06 +08:00
Fix: metadata update issue (#12815)
### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -675,8 +675,7 @@ class DocumentService(CommonService):
|
|||||||
if k not in old:
|
if k not in old:
|
||||||
old[k] = v
|
old[k] = v
|
||||||
continue
|
continue
|
||||||
if isinstance(v, dict):
|
if isinstance(v, dict) and isinstance(old[k], dict):
|
||||||
assert isinstance(old[k], dict)
|
|
||||||
dfs_update(old[k], v)
|
dfs_update(old[k], v)
|
||||||
else:
|
else:
|
||||||
old[k] = v
|
old[k] = v
|
||||||
@ -863,11 +862,9 @@ class DocumentService(CommonService):
|
|||||||
key = upd.get("key")
|
key = upd.get("key")
|
||||||
if not key:
|
if not key:
|
||||||
continue
|
continue
|
||||||
if key not in meta:
|
|
||||||
meta[key] = upd.get("value")
|
|
||||||
|
|
||||||
new_value = upd.get("value")
|
new_value = upd.get("value")
|
||||||
match_provided = "match" in upd
|
match_provided = upd.get("match")
|
||||||
if key not in meta:
|
if key not in meta:
|
||||||
if match_provided:
|
if match_provided:
|
||||||
continue
|
continue
|
||||||
@ -880,7 +877,7 @@ class DocumentService(CommonService):
|
|||||||
if isinstance(new_value, list):
|
if isinstance(new_value, list):
|
||||||
meta[key] = dedupe_list(new_value)
|
meta[key] = dedupe_list(new_value)
|
||||||
else:
|
else:
|
||||||
meta[key] = new_value
|
meta[key].append(new_value)
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
match_value = upd.get("match")
|
match_value = upd.get("match")
|
||||||
|
|||||||
Reference in New Issue
Block a user