Skip to content

docs(b9): say that search folds case over all of Unicode, at every length - #112

Merged
lessevv merged 1 commit into
mainfrom
docs/b9-case-folding
Sep 13, 2026
Merged

lessevv merged 1 commit into
mainfrom
docs/b9-case-folding

Conversation

@lessevv

@lessevv lessevv commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

B9 describes two matching arms — the index for a query long enough to tokenise, a bounded scan for one that is not — and says nothing about how either compares. Measured in the product, they do not compare alike.

SQLite's LIKE and LOWER() fold ASCII and nothing else; FTS5's trigram tokeniser folds over the whole of Unicode. The arm is picked by the query's length, so the length of a word decided whether its accents mattered. Over a body containing MÖRK BAR, on the shipped SQLite build:

needle characters arm result
ör 2 fallback scan not found
örk 3 index found
ÖR 2 fallback scan found
ÖRK 3 index found

A reader typing their merchant's name in the case they see it on screen got nothing, and the app offered no reason. That is reader-visible behaviour with no requirement over it.

B9-R19 states the rule: case-insensitive matching folds over the whole of Unicode rather than ASCII alone, applies the same fold in every arm, and does not strip diacritics — ö finds Ö, o still does not find ö, which is what the index has always done.

Also adds the matching bullet to Search behaviour and the edge-case row, so the requirement is not the only place the page says it.

No existing identifier is renumbered or reused.

…ngth

B9 described two matching arms -- the index for a query long enough to
tokenise, a bounded scan for one that is not -- and said nothing about how
either compares. Measured in the product, they did not compare alike: the
index folds case over the whole of Unicode and the fallback folded ASCII,
so a reader typing their merchant's name in the case they see it found the
row at three characters and not at two.

That is reader-visible behaviour with no requirement over it, so B9-R19
states it: one fold, Unicode-wide, the same in every arm, and case only --
folding case is not stripping accents, and `o` still does not find `ö`.

Signed-off-by: Wessel Verheij <info@nightworks.io>
@sonarqubecloud

Copy link
Copy Markdown

@lessevv
lessevv enabled auto-merge (squash) September 13, 2026 14:38
@lessevv
lessevv merged commit b86c13f into main Sep 13, 2026
13 checks passed
@github-actions github-actions Bot added the awaiting-maintainer Green PR with no review — a maintainer needs to act label Sep 13, 2026
@github-actions github-actions Bot added awaiting-maintainer Green PR with no review — a maintainer needs to act and removed awaiting-maintainer Green PR with no review — a maintainer needs to act labels Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-maintainer Green PR with no review — a maintainer needs to act documentation Docs only functional

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant