Skip to content

Search finds a title when a word has another ending - #48

Merged
jpittelkow merged 1 commit into
mainfrom
search-word-endings
Nov 26, 2026
Merged

jpittelkow merged 1 commit into
mainfrom
search-word-endings

Conversation

@jpittelkow

@jpittelkow jpittelkow commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What this changes and why

A search for "I killed the bear" didn't surface the show "I Kill the Bear":

  • Search words match as the start of a word, so killed* never matches "Kill".
  • With no item holding every word, the guide and the library each ran their own all-but-one-word fallback. For a two-word search that means either word, so On TV filled with games for teams named Bears and the library with every bear film.

search.run now tries three levels, across guide, library and episodes together, and stops at the first level that finds anything:

  1. exact: the words as typed.
  2. stem: the words with -ing/-ed/-es/-s dropped (search.stem).
  3. loose: the old fallback, never for episode titles.

A library title equal to the whole search comes first. /api/library retries without endings when the words as typed find nothing.

How it was tested

  • python scripts/check.py prints "all checks passed" (tests, guard tests, privacy, JS)
  • New or changed behaviour has a test that fails without this change (3 new tests in tests/test_core.py; all three fail on main)
  • CHANGELOG.md (Unreleased) updated, if a user would notice
  • For screen changes: checked at phone width and in light and dark mode (no screen changes)

Tried on real hardware (TV model and app, or "not tried"): not tried (search only). Ran search.run against a copy of a real library: the reported search now returns the show first, and several other common searches return what they did before.

Not tested: the running app in a browser.

Decisions and docs

ADRs I reviewed for this area (numbers): 0015, 0029, 0030

  • This makes or reverses a design decision, and adds or supersedes an ADR: 0031 (Proposed)
  • No ADR needed (say why, in a few words):
  • Nothing here goes against an accepted ADR
  • docs/ and the README still match the code, or were updated here

Security (tick what applies)

  • None of the above

AI use

  • No AI was used
  • AI helped. Tool, and what it did: Claude Code diagnosed the problem, wrote the change, tests and ADR
  • A person read the whole diff and can explain it

Checks

  • One change only, with no unrelated cleanups
  • No keys, tokens or details of a real home in the code, tests, logs or screenshots
  • No new dependencies, workflow changes or version bumps, or they were agreed in an issue

🤖 Generated with Claude Code

"I killed the bear" didn't surface "I Kill the Bear": "killed" isn't a
prefix of "Kill", and each section's any-word fallback filled On TV and
the library with one-word near misses (Chicago Bears games, bear films).

Search now tries three levels across guide, library and episodes together
(exact words, words without common endings, all-but-one of the words) and
stops at the first that finds anything. An exact library title comes first.
ADR 0031 (Proposed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jpittelkow
jpittelkow merged commit 551c43d into main Nov 26, 2026
3 checks passed
@jpittelkow
jpittelkow deleted the search-word-endings branch November 26, 2026 20:56
@jpittelkow jpittelkow mentioned this pull request Nov 26, 2026
jpittelkow added a commit that referenced this pull request Nov 26, 2026
Version bump and CHANGELOG for 0.2.10: search finds a title when a word
has another ending (#48). Also rewords one line of ADR 0031.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jeff Pittelkow <6314033+jpittelkow@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant