Lowercased, deduplicated terms using KG FTS rules plus a small allowlist of meaningful short technology names. Exact token matching prevents substring matches such as `rust` in `trust`.
(seed_query: &str)
| 556 | /// meaningful short technology names. Exact token matching prevents substring |
| 557 | /// matches such as `rust` in `trust`. |
| 558 | fn search_terms(seed_query: &str) -> Vec<String> { |
| 559 | let mut terms = tokenize_for_fts(seed_query); |
| 560 | terms.extend( |
| 561 | seed_query |
| 562 | .split(|character: char| !character.is_alphanumeric() && character != '_') |
| 563 | .map(str::to_lowercase) |
| 564 | .filter(|term| SHORT_TECH_TERMS.contains(&term.as_str())), |
| 565 | ); |
| 566 | terms.sort(); |
| 567 | terms.dedup(); |
| 568 | terms |
| 569 | } |
| 570 | |
| 571 | /// Fraction of seed terms present as exact body tokens (case-insensitive). |
| 572 | fn body_match_fraction(terms: &[String], body: &str) -> f64 { |