Neutralises the value delimiter (backtick — Typesense has no documented escape for it, so it is
removed) and the boolean operator sequences && / ||. Everything else is left alone.
An earlier version also stripped the character class [&|:[]()], which corrupted legitimate
values: an iso-date dimension carrying a time (2026-07-28T10:30:00Z) came back as
2026-07-28T103000Z, so the filter silently matched nothing. Found by probing the "no-op on
legitimate values" claim rather than by review. The contract here mirrors the SQL escaper's:
neutralise the delimiter and assume the template quoted the value, exactly as a SQL template must
supply its own single quotes.
Escape a value for a Typesense
filter_byclause.Neutralises the value delimiter (backtick — Typesense has no documented escape for it, so it is removed) and the boolean operator sequences
&&/||. Everything else is left alone.An earlier version also stripped the character class
[&|:[]()], which corrupted legitimate values: aniso-datedimension carrying a time (2026-07-28T10:30:00Z) came back as2026-07-28T103000Z, so the filter silently matched nothing. Found by probing the "no-op on legitimate values" claim rather than by review. The contract here mirrors the SQL escaper's: neutralise the delimiter and assume the template quoted the value, exactly as a SQL template must supply its own single quotes.