You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
829 B
19 lines
829 B
import ijson
|
|
from Tools.KG_Config import TOPIC
|
|
|
|
# 文件路径
|
|
file_path = rf"{TOPIC}\kv_store_doc_status.json"
|
|
|
|
# 使用ijson流式读取JSON文件
|
|
with open(file_path, 'r', encoding='utf-8') as f:
|
|
# 流式迭代文档ID和状态信息
|
|
for doc_id, status_info in ijson.kvitems(f, ''):
|
|
print(f"文档ID: {doc_id}")
|
|
print(f"状态: {status_info['status']}")
|
|
print(f"分块数量: {status_info['chunks_count']}")
|
|
print(f"内容摘要: {status_info['content_summary'][:100]}...") # 打印前100字符
|
|
print(f"内容长度: {status_info['content_length']}字符")
|
|
#print(f"创建时间: {status_info['created_at']}")
|
|
#print(f"更新时间: {status_info['updated_at']}")
|
|
#print(f"文件路径: {status_info['file_path']}")
|
|
print("---") |