Skip to content

Commit

Permalink
feat: add org scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Nov 29, 2024
1 parent caabb0f commit a7dbe5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/home/search/search-scorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ export class SearchScorer {
let score = 0;
if (issue.repository_url) {
const repoName = issue.repository_url.split("/").pop()?.toLowerCase() || "";
const orgName = issue.repository_url.split("/").slice(-2)[0].toLowerCase() || "";
searchTerms.forEach((term) => {
if (repoName.startsWith(term.toLowerCase())) {
matchDetails.repoMatch = true;
score += term.length / repoName.length;
}
if (orgName.startsWith(term.toLowerCase())) {
score += term.length / orgName.length;
}
});
}
return score;
Expand Down

0 comments on commit a7dbe5e

Please sign in to comment.