Skip to content

SemanticSearch.search() can raise “No matching observation” after finding matches #4034

Description

@omarespejel

Found this while testing a Go2 recording. Vector search returned matches, but SemanticSearch.search() still raised LookupError: No matching observation.

search() sorts by similarity, but peaks() expects time order. Descending scores have no interior peaks, so it returns nothing. Separately, .last() chooses the latest peak instead of the strongest one.

I reproduced it on main at 1875e3e5a with a small SQLite test. Sorting by timestamp before finding peaks, then choosing the strongest peak, makes the regression tests pass.

I have the fix and regression tests locally. Happy to open a 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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions