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)
| 153 | /// allowlist of meaningful short technology names. Exact token |
| 154 | /// matching prevents substring matches such as `rust` in `trust`. |
| 155 | fn search_terms(seed_query: &str) -> Vec<String> { |
| 156 | let mut terms = tokenize_for_fts(seed_query); |
| 157 | terms.extend( |
| 158 | seed_query |
| 159 | .split(|character: char| !character.is_alphanumeric() && character != '_') |
| 160 | .map(str::to_lowercase) |
| 161 | .filter(|term| SHORT_TECH_TERMS.contains(&term.as_str())), |
| 162 | ); |
| 163 | terms.sort(); |
| 164 | terms.dedup(); |
| 165 | terms |
| 166 | } |
| 167 | |
| 168 | /// Fraction of seed terms present as exact body tokens. |
| 169 | fn body_match_fraction(terms: &[String], body: &str) -> f64 { |
no test coverage detected