Sanitize a user query for FTS5. Quote-wraps any token containing
non-alphanumerics so hyphens / colons / dots are treated literally
(without this, "claude-telegram" would parse as claude NOT telegram).
v3.7.16 P3-28 — reserved keywords (AND, OR, NOT, NEAR) are
QUOTED as literals instead of stripped. Pre-3.7.16 the strip-path
silently dropped real query terms ("operating systems AND databases"
lost the connective AND user couldn't search for the literal word
"AND"). Quoting makes both cases work: FTS5 treats "AND" as the
literal token rather than the boolean operator.
Parameters
q: string
User query string.
Returns string
Sanitized query ready to pass to FTS5's MATCH operator.
Empty string when input is empty / whitespace-only.
Sanitize a user query for FTS5. Quote-wraps any token containing non-alphanumerics so hyphens / colons / dots are treated literally (without this,
"claude-telegram"would parse asclaude NOT telegram).v3.7.16 P3-28 — reserved keywords (
AND,OR,NOT,NEAR) are QUOTED as literals instead of stripped. Pre-3.7.16 the strip-path silently dropped real query terms ("operating systems AND databases" lost the connective AND user couldn't search for the literal word "AND"). Quoting makes both cases work: FTS5 treats"AND"as the literal token rather than the boolean operator.