Peterase commited on
Commit
2d8a9a6
·
1 Parent(s): 2acfa1a

fix: handle None values in hybrid result deduplication

Browse files

- Use (r.get('url') or '') instead of r.get('url', '')
- Prevents 'NoneType' object has no attribute 'lower' error
- Allows hybrid search results to be properly merged and ranked

src/core/ranking/hybrid_result_ranker.py CHANGED
@@ -203,8 +203,8 @@ class HybridResultRanker:
203
  unique = []
204
 
205
  for r in results:
206
- url = r.get("url", "").lower().strip()
207
- title = r.get("title", "").lower().strip()
208
 
209
  # Generate URL hash for exact matching
210
  url_hash = hashlib.md5(url.encode()).hexdigest() if url else None
 
203
  unique = []
204
 
205
  for r in results:
206
+ url = (r.get("url") or "").lower().strip()
207
+ title = (r.get("title") or "").lower().strip()
208
 
209
  # Generate URL hash for exact matching
210
  url_hash = hashlib.md5(url.encode()).hexdigest() if url else None