Skip to content

Search never matches folder names (or the suggested file name), although the README says it searches "descriptions and paths": -q vacation finds nothing in /photos/vacation/ #182

Description

@matt-edmondson

What's wrong

The README's verb table says Search does "Keyword search across stored descriptions and paths" (README.md:65). The implementation only checks the description and each known path's file name (Search.cs:49):

|| kvp.Value.KnownPaths.Any(p => p.FileName.Contains(options.Query, StringComparison.OrdinalIgnoreCase))

Repro

  1. Store an entry with Description = "a cat on a sofa" and KnownPaths = ["/photos/vacation/img1.jpg"], via Scan or Import.
  2. Run ImageDescriber Search -q vacation.

Actual output: Search results for "vacation": 0 match(es). Expected: 1 match.

SuggestedFileName, which the model generates and Search prints for each result, isn't searched either.

Why it matters

Folder names (trip, year, event, person) are usually the only organisation a photo library has. Searching by them is the obvious query, and it silently returns nothing, so users conclude the images aren't in the database.

Suggested fix / acceptance criteria

  • Match the query against the full path (p.WeakString / p.ToString()) rather than only p.FileName. Also match SuggestedFileName.
  • Add a test: an entry whose only mention of the query is in a parent directory name is returned.
  • If filename-only matching is intentional, change the README to say "descriptions and file names" instead.

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