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)
| 511 | /// meaningful short technology names. Exact token matching prevents substring |
| 512 | /// matches such as `rust` in `trust`. |
| 513 | fn search_terms(seed_query: &str) -> Vec<String> { |
| 514 | let mut terms = tokenize_for_fts(seed_query); |
| 515 | terms.extend( |
| 516 | seed_query |
| 517 | .split(|character: char| !character.is_alphanumeric() && character != '_') |
| 518 | .map(str::to_lowercase) |
| 519 | .filter(|term| SHORT_TECH_TERMS.contains(&term.as_str())), |
| 520 | ); |
| 521 | terms.sort(); |
| 522 | terms.dedup(); |
| 523 | terms |
| 524 | } |
| 525 | |
| 526 | /// Fraction of seed terms present as exact body tokens (case-insensitive). |
| 527 | fn body_match_fraction(terms: &[String], body: &str) -> f64 { |