Repository navigation
Rank API methods by name matches first - #315
Merged
Merged
Conversation
Search ranked all words of a method alike, and stemmed every word, so a query for "issues" ranked issueShare and issueArchive, whose documentation mentions issues often, above the method named issues. Ranking is now BM25F: the method name and its documentation are separately normalized fields, and a word in the name counts three times as much. Names also keep their words as written next to the stems, so a query word that matches a name exactly ranks it above names that only share the stem. The search index moves to format 4 and is rebuilt.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | a2f6e3f | Nov 22 2026, 10:32 PM |
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
MCP
searchranks methods with BM25 over one bag of stemmed words: the method name, parameter names and descriptions, and the summary count alike. In APIs with many related methods, the method a query names loses to methods that mention its words more often. In the Linear template,issues(the issue list) does not appear on the first page for "issues":issueUnshare,issueShareandissueUnarchiverank first. Two agents testing the template without context each needed a second search to find it.What changes
issuesexactly andissueShareonly by stem. Queries still match every method by stem, as before.nameTermsnext toterms. Indexes of format 3 are rebuilt; app deployments are not needed.Neither is specific to an API: no synonyms, verb rules or name-equality bonus.
Measured on generated APIs (top result before → after)
issueUnshare/issueToReleases→issuesremoveIssueTypeFromIssueTypeScheme→createIssuesissueToRelease→ unchangedgetIssueSecurityLevel→getIssueissueCreate→ unchangedgetCreateIssueMetaIssueTypes→createIssueproject/commentDelete→projects/commentsupdateProjectAvatar/deleteCommentProperty→searchProjects/getCommentsteams→ unchangedgetPlanOnlyTeam→getTeamsGitHub's GraphQL API, whose lists are fields of
repositoryrather than methods, changes mixed: "comments" now findsaddCommentand "current user" findsuser, while "repositories" ranks enterprise settings such asupdateEnterpriseMembersCanCreateRepositoriesSettingaboverepository.Verification
pnpm checkpnpm exec vitest run apps/control-plane packagesRUN_SERVICE_TESTS=1runtime service tests (workerd and celld), including MCP search

Confidence Score: 5/5
The PR appears safe to merge.Summary
Search now gives method names more weight and favors matching plural spellings.
Reviews (1) · Last reviewed commit: "Rank API methods by name matches first" · Reviewed by Greptile