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)
| 584 | /// meaningful short technology names. Exact token matching prevents substring |
| 585 | /// matches such as `rust` in `trust`. |
| 586 | fn search_terms(seed_query: &str) -> Vec<String> { |
| 587 | let mut terms = tokenize_for_fts(seed_query); |
| 588 | terms.extend( |
| 589 | seed_query |
| 590 | .split(|character: char| !character.is_alphanumeric() && character != '_') |
| 591 | .map(str::to_lowercase) |
| 592 | .filter(|term| SHORT_TECH_TERMS.contains(&term.as_str())), |
| 593 | ); |
| 594 | terms.sort(); |
| 595 | terms.dedup(); |
| 596 | terms |
| 597 | } |
| 598 | |
| 599 | /// Fraction of seed terms present as exact body tokens (case-insensitive). |
| 600 | fn body_match_fraction(terms: &[String], body: &str) -> f64 { |