semantic bufo search find-bufo.com
bufo

filter out zero-scored results from hybrid search

problem: when alpha=0.0 (pure keyword), results from vector search
that don't match the keyword were appearing with 0.0 scores, polluting
the result set with irrelevant bufos

solution: filter out results with score < 0.001 before sorting
- prevents vector-only results when alpha=0.0 (pure keyword)
- prevents keyword-only results when alpha=1.0 (pure semantic)
- keeps result set clean and relevant

tested:
- query=redis, alpha=0.0 → 1 result (was 5 with 4 zeros) ✓
- query=bufo, alpha=0.0 → 5 clean results (no zeros) ✓
- query=happy, alpha=0.5 → balanced hybrid mix ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

+5
+5
src/search.rs
··· 263 263 }) 264 264 .collect(); 265 265 266 + // filter out zero-scored results (irrelevant matches from the other search method) 267 + // this prevents vector-only results from appearing when alpha=0.0 (pure keyword) 268 + // and keyword-only results from appearing when alpha=1.0 (pure semantic) 269 + fused_scores.retain(|(_, score)| *score > 0.001); 270 + 266 271 // sort by fused score (descending) and take top_k 267 272 fused_scores.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap()); 268 273 fused_scores.truncate(top_k_val);