You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
/find/ resolves the wrong work when a registered label contains a space #130
/find/ resolves the wrong work when a registered label contains a space.
interpret in src/lib/find.ts splits a query into a work part and a locator part. It retries rankWorks on the whole query only when the split produces zero matches. An exact match on the full query therefore loses to a match on a truncated one.
Reproduce
Search /find/ for MA II/1.
MA II/1 is a registered alternative label of nietzsche.vermischte-meinungen.
The split yields workQuery = "MA" and locator = "II/1". MA is an exact alternative label of nietzsche.menschliches-allzumenschliches, so the split produces one match and the retry never runs.
The page reports locator-invalid for the wrong work: "'II/1' is not a passage number any text in the registry uses."
Suggested fix
Rank the whole query first. An exact label match on the full query must outrank a match on a truncated query at the same tier.
Found during review of #127. Not caused by that PR.
Fixed on staging by d9239bd (#138). The whole query is ranked whenever a locator was split off, and wins at an equal or better tier. MA II/1 and MA II/2 now reach their own works. A registry-wide sweep goes 114/116 → 116/116, with the label-plus-locator sweep unchanged at 93/93.
The fix ships with the v0.1.0 release, #4. Closing now rather than at the tag, because the change is on staging and Closes does not fire from a merge into a non-default branch.
Activity
fix(site): let a whole-query label beat a split match in /find/ (#138)
maehr commentedon Sep 2, 2026
Fixed on
stagingbyd9239bd(#138). The whole query is ranked whenever a locator was split off, and wins at an equal or better tier.MA II/1andMA II/2now reach their own works. A registry-wide sweep goes 114/116 → 116/116, with the label-plus-locator sweep unchanged at 93/93.The fix ships with the
v0.1.0release, #4. Closing now rather than at the tag, because the change is onstagingandClosesdoes not fire from a merge into a non-default branch.