pub fn fts_query(q: &str) -> Option { let terms: Vec = q .split_whitespace() .map(|t| t.trim_matches(['"', '\'', '*', '(', ')', ':', '[', ']'])) .filter(|t| !t.is_empty()) .map(|t| format!("\"{}\"", t)) .collect(); if terms.is_empty() { None } else { Some(terms.join(" AND ")) } }