Repository navigation
feat(search): answer filter-only queries and match repo: by name - #22
Merged
Merged
Conversation
A query with filters but no plain terms used to return an empty page, so `has:error` or `agent:codex` alone showed "no results". It now returns one hit per matching session, newest first, under the same keyset pagination. Relevance falls back to newest; Oldest is honoured. A query with neither terms nor filters still returns nothing. `repo:` previously matched only an internal repository id. It now also matches a repository's display name and the last component of its root path, case-insensitively. A name shared by several repositories matches all of them, and an unknown name matches nothing. Filter-only hits describe the session from its first redacted projection document, never from raw session text. All filter values stay bound parameters; the repo: candidates travel as one JSON array parameter.
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The rebuilt UI puts the query syntax front and center. Two gaps made the search line feel broken.
has:errororagent:codex, returned an empty page.repo:matched only an internal repository id. Typingrepo:lorematched nothing.What changed
SearchHitper matching session, newest first.next_cursorappears only on a full page.SortOrder::Relevancefalls back to newest.Oldestis honoured. The doc comment onsearch_pagesays so.agent:orgit-source:bogus.lore-ipcunchanged:search_document. That is the native title if there is one (session/title), otherwise the opening message (message_part).snippetis that redacted text, whitespace-collapsed and cut to 160 characters, with no highlight markers.rankis 0. A session with no projected text getssession/titleand an empty snippet.repo:now accepts a repository id, a display name, or the last component ofprimary_path.LIKE. The candidate ids go to SQL as one JSON array parameter.Scope
crates/lore-core/src/search.rscrates/lore-core/tests/search.rslore-ipc,query.rs,ingest.rs, migrations, adapters,src/, orsrc-tauri/.Blast Radius
lorectl search, and thelorectl mcpsearch tool all callsearch_page. A filter-only query now lists sessions in each of them instead of returning nothing.repo:<name>now resolves names.search_document.redacted_text, never from raw message text.repo:reads the wholerepositorytable once per query that uses it. That table has one row per repository.Verification
cargo fmt --all -- --check: passed.cargo clippy -p lore-core -p lore-ipc -p lorectl --all-targets --all-features -- -D warnings: passed.cargo test -p lore-core --test search: 40 passed, 0 failed. 14 of the 40 are new. Four new unit tests cover the helpers.cargo test --workspace: exit 0, no failures.scripts/synth-archive.sh /tmp/sf-homes 30 20 7, thenlorectl scan):agent:codexlists the 20 Codex sessions.agent:claude-codefills the CLI's 20-row page.has:errorreports no matches, because the synthetic archive has no failed tool calls. The tests cover it.repo:was checked on a copy with one repository row and its link rows added by SQL.repo:repo_demo,repo:loreappandrepo:DEMO-displayeach returned the same 7 sessions.repo:nopeandrepo:*returned none.~/.claude,~/.codexand the default archive were not touched.lorectl mcpend to end.