Browse Source

代码提交

SGTY 2 tháng trước cách đây
mục cha
commit
fca7d9e432
2 tập tin đã thay đổi với 104 bổ sung0 xóa
  1. 100 0
      app.log
  2. 4 0
      router/graph_router.py

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 100 - 0
app.log


+ 4 - 0
router/graph_router.py

@@ -87,6 +87,10 @@ async def neighbor_search(
             entities, relations = graph_helper.neighbor_search(item["id"], 1)
             max = 20 #因为类似发热这种疾病会有很多关联的疾病,所以需要防止检索范围过大,设置了上限
             for neighbor in entities:
+
+                #有时候数据中会出现链接有的节点,但是节点数据中缺失的情况,所以这里要检查
+                if "type" not in neighbor.keys():
+                    continue
                 if neighbor["type"] == neighbor_type:
                     #如果这里正好找到了要求检索的节点类型
                     if neighbor["id"] not in neighbors_data: