feat(sessions): BM25-ranked session search with search-index feature Refs #758#831
Merged
AlexMikhalev merged 8 commits intomainfrom Apr 22, 2026
Merged
feat(sessions): BM25-ranked session search with search-index feature Refs #758#831AlexMikhalev merged 8 commits intomainfrom
AlexMikhalev merged 8 commits intomainfrom
Conversation
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.
Summary
Replaces brute-force substring matching in session search with BM25 (Okapi) scoring for relevance-ranked results, reusing the existing BM25 infrastructure from
terraphim_types::score.Changes
Step 1: Extract score module to terraphim_types
terraphim_service::scoretoterraphim_types::scoreStep 2: Re-export from terraphim_service
terraphim_service::scoreis now a thin re-export shim:pub use terraphim_types::score::*Step 3: search-index feature for terraphim_sessions
search-indexfeature flag depending onterraphim_typessession_to_document()adapter convertsSession→Document(title + body from messages + metadata)search_sessions()performs BM25-ranked search with relative score threshold filteringStep 4: Replace brute-force search
SessionService::search()now uses BM25 whensearch-indexfeature is enabled#[cfg])Step 5: /sessions index CLI command
SessionsSubcommand::Index { verbose }with parserTesting
search-indexfeatureRefs #758 (Gitea)