pub fn prepare_search_query(raw: &str) -> Result<PreparedQuery>Expand description
Build a safe FTS5 MATCH string and ranking tokens from raw user input.
Strategy:
- Tokenize (punctuation-safe)
- Prefer significant (non-stopword) tokens
- Single token → exact quoted match
- Multiple tokens →
ORbetween them for natural-language recall (documents rarely contain every filler word from a full question)
§Errors
Returns BrainError::FtsQuery when no usable token remains.