fix(search): split dotted tokens in FTS5 queries so version strings match; fix HTTP API path prefix#696
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #563, fixes #576
Bug 1: FTS5 doesn't match dotted version strings (#563)
Root cause:
sanitizeFTS5Termstrips all non-alphanumeric chars including dots, so2026.4.10becomes2026410— which never matches the indexed tokens2026,4,10(theunicode61tokenizer splits on dots).Fix: Added
isDottedToken()+sanitizeDottedTerm()helpers (mirrors the existing hyphen-splitting logic). When a search term looks like a dotted version string, it's split on dots and the parts are AND'd:2026.4.10→"2026"* AND "4"* AND "10"*.Bug 2: HTTP API returns paths without
qmd://prefix (#576)Root cause: The REST
/queryendpoint returnedr.displayPath(collection/path) directly, while the CLI returnsqmd://collection/path. TheencodeQmdPath()helper existed but wasn't applied to the REST response.Fix: One-liner — wrap
displayPathwithencodeQmdPath()in the REST handler so HTTP API output matches CLI output.Tests
test/store.test.ts: regression test forsearchFTS("2026.4.10")finding a doc that contains the stringtest/mcp.test.ts: asserts everyfilefield in REST query results starts withqmd://