MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / rankGHResults

Function rankGHResults

internal/cli/management.go:722–728  ·  view source on GitHub ↗

rankGHResults sorts GitHub search results by relevance score (highest first).

(results []ghSearchResult, query string)

Source from the content-addressed store, hash-verified

720
721// rankGHResults sorts GitHub search results by relevance score (highest first).
722func rankGHResults(results []ghSearchResult, query string) {
723 sort.SliceStable(results, func(i, j int) bool {
724 si := relevanceScore(results[i].Name, results[i].Description, results[i].Repo, results[i].Stars, query)
725 sj := relevanceScore(results[j].Name, results[j].Description, results[j].Repo, results[j].Stars, query)
726 return si > sj
727 })
728}
729
730// searchConfiguredReposTiered searches configured repos and returns results
731// split into two tiers: local (from skill_repos.json) and remote (from config.yaml).

Callers 1

entitySearchCommandFunction · 0.85

Calls 1

relevanceScoreFunction · 0.85

Tested by

no test coverage detected