马一丁

Incorrect iteration over graph nodes dictionary

@@ -104,7 +104,8 @@ class QueryEngine: @@ -104,7 +104,8 @@ class QueryEngine:
104 """关键词匹配""" 104 """关键词匹配"""
105 matched_ids = set() 105 matched_ids = set()
106 106
107 - for node in self.graph.nodes: 107 + # 使用 .values() 遍历 Node 对象,而非字典键
  108 + for node in self.graph.nodes.values():
108 # 类型筛选 109 # 类型筛选
109 if params.node_types and node.type not in params.node_types: 110 if params.node_types and node.type not in params.node_types:
110 continue 111 continue