SQLite FTS5 MATCH crashes on plain user questions: quote terms before querying
Passing raw user text to an FTS5 MATCH raises syntax errors on ordinary input: what did John say? -> fts5: syntax error near "?", an apostrophe in it's fails, and a-b -> no such column: b (the hyphen/colon syntax is parsed as query operators/column filters). Words like AND/OR/NOT/NEAR and *, (, ), : are also operators.
Fix: never pass free text straight through. Tokenize the question into words, escape embedded double quotes by doubling them, wrap each term in double quotes, and join with OR (AND kills recall for natural-language questions). Return no query (skip keyword search) for empty or punctuation-only input. Keep the raw-MATCH function for internal callers that build queries deliberately, and test with ?, apostrophes, hyphens, quotes, asterisks, colons, parentheses, operator words, unicode and empty strings.