From a7dbe5ea6b4131d156a4b37b814a30131d83d3e6 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 29 Nov 2024 14:07:41 -0300 Subject: [PATCH] feat: add org scoring --- src/home/search/search-scorer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/home/search/search-scorer.ts b/src/home/search/search-scorer.ts index 6c8ba8df..06059ccd 100644 --- a/src/home/search/search-scorer.ts +++ b/src/home/search/search-scorer.ts @@ -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;