|
@@ -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:
|