Problem
/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.
Problem
/find/resolves the wrong work when a registered label contains a space.interpretinsrc/lib/find.tssplits a query into a work part and a locator part. It retriesrankWorkson 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
/find/forMA II/1.MA II/1is a registered alternative label ofnietzsche.vermischte-meinungen.workQuery = "MA"andlocator = "II/1".MAis an exact alternative label ofnietzsche.menschliches-allzumenschliches, so the split produces one match and the retry never runs.locator-invalidfor 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.