Skip to content

Fix/1577 search special chars - #1578

Merged
perber merged 1 commit into
mainfrom
fix/1577-search-special-chars
Sep 22, 2026
Merged

perber merged 1 commit into
mainfrom
fix/1577-search-special-chars

Conversation

@perber

@perber perber commented Sep 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

…yntax

buildFuzzyQuery made one whole-query trust decision for whether input was
deliberate FTS5 syntax, so any query containing an operator character
anywhere (*, (, ), :, AND, OR) was passed to SQLite unescaped. A comma or
apostrophe in an otherwise plain search (e.g. "hello, world", "it's")
reached FTS5's query parser unescaped and failed with a syntax error,
surfaced to callers as a 500 (#1577).

Replaces the whole-query heuristic with per-field classification: each
whitespace-separated field is judged on its own (quoted phrase, real
column filter, boolean operator between real operands, or literal text)
instead of one field's syntax vouching for the whole query. Literal text
is split into the same word units the table's tokenizer would produce and
AND-ed together as quoted-prefix terms, sidestepping a SQLite unicode61
quirk where phrase-adjacency doesn't survive a mid-word apostrophe.

Also fixes, found via review of the above: bare colon crashing on pasted
URLs/paths/times, dangling/doubled AND-OR-NOT, bare standalone */(/),
punctuation-only queries crashing on MATCH '', and column filters with
punctuation values now stay column-scoped instead of crashing or silently
searching every column.

Fixes #1577
@perber
perber force-pushed the fix/1577-search-special-chars branch from 8be379e to eebae1e Compare September 21, 2026 15:48
@perber
perber merged commit 839c132 into main Sep 22, 2026
9 checks passed
@perber
perber deleted the fix/1577-search-special-chars branch September 22, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant