mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-02 00:25:06 +08:00
Fix metadata in get_list() (#12906)
### What problem does this PR solve? test_update_document.py failed as metadata is not included in the response of get_list(), fix the issue. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -109,7 +109,12 @@ class DocumentService(CommonService):
|
||||
|
||||
count = docs.count()
|
||||
docs = docs.paginate(page_number, items_per_page)
|
||||
return list(docs.dicts()), count
|
||||
|
||||
docs_list = list(docs.dicts())
|
||||
metadata_map = DocMetadataService.get_metadata_for_documents(None, kb_id)
|
||||
for doc in docs_list:
|
||||
doc["meta_fields"] = metadata_map.get(doc["id"], {})
|
||||
return docs_list, count
|
||||
|
||||
@classmethod
|
||||
@DB.connection_context()
|
||||
|
||||
Reference in New Issue
Block a user