Improve search quality: ranking, symbol search, and result grouping#21
Merged
Improve search quality: ranking, symbol search, and result grouping#21
Conversation
- Move result ranking from zoekt-client to API layer with enhanced signals: recency (mtime), symbol definition detection, match density, header/Public boost - Add Zoekt sym: symbol search with DB fallback for /find-type and /find-member - Add grouped=true query param to /grep for file-grouped results - Extract ranking/grouping helpers into search-ranking.js for testability - Add 38 unit tests covering all new functionality Closes #16 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@claude Please review this PR. Focus on:
Use the opus model for thorough analysis. |
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
sym:query support viasearchSymbols()method./find-typeand/find-memberendpoints acceptuseZoekt=trueto try Zoekt first with automatic DB fallbackgrouped=truequery param to/grepthat returns results grouped by file ({ file, project, language, matches: [...] })Key Changes
src/service/search-ranking.js— New module withisDefinitionLine(),recencyScore(),rankResults(),groupResultsByFile()src/service/zoekt-client.js— Removed ranking from_mapResponse(), addedsearchSymbols()src/service/api.js— Wired ranking + grouping into/grep, added Zoekt symbol search to/find-typeand/find-membersrc/service/database.js— AddedgetFilesMtime()batch querytest-search-quality.js— 38 unit tests covering all new functionalityCloses #16
Test plan
node test-search-quality.js— 38/38 tests pass/grep?pattern=UPlayerController— verify definitions/recent files rank higher/grep?pattern=GetWorld&grouped=true— verify file-grouped response/find-type?name=APlayerController&useZoekt=true— verify Zoekt attempt with DB fallback🤖 Generated with Claude Code