Skip to content

/find/ resolves the wrong work when a registered label contains a space #130

Description

@maehr

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

  1. Search /find/ for MA II/1.
  2. MA II/1 is a registered alternative label of nietzsche.vermischte-meinungen.
  3. 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.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions