Ver código fonte

代码提交

SGTY 2 meses atrás
pai
commit
fca7d9e432
2 arquivos alterados com 104 adições e 0 exclusões
  1. 100 0
      app.log
  2. 4 0
      router/graph_router.py

Diferenças do arquivo suprimidas por serem muito extensas
+ 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: