feat(search): update search pattern matching rules (#1257)

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
LaurentiuNiculae
2023-03-22 19:31:53 +02:00
committed by GitHub
parent fb85c8678c
commit f8a77bc42f
14 changed files with 83 additions and 264 deletions
@@ -897,7 +897,7 @@ func (bdw *DBWrapper) SearchRepos(ctx context.Context, searchText string, filter
return err
}
if score := common.ScoreRepoName(searchText, string(repoName)); score != -1 {
if rank := common.RankRepoName(searchText, string(repoName)); rank != -1 {
var (
// specific values used for sorting that need to be calculated based on all manifests from the repo
repoDownloads = 0
@@ -1006,7 +1006,7 @@ func (bdw *DBWrapper) SearchRepos(ctx context.Context, searchText string, filter
pageFinder.Add(repodb.DetailedRepoMeta{
RepoMeta: repoMeta,
Score: score,
Rank: rank,
Downloads: repoDownloads,
UpdateTime: repoLastUpdated,
})