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
@@ -829,7 +829,7 @@ func (dwr *DBWrapper) SearchRepos(ctx context.Context, searchText string, filter
continue
}
if score := common.ScoreRepoName(searchText, repoMeta.Name); score != -1 {
if rank := common.RankRepoName(searchText, repoMeta.Name); rank != -1 {
var (
// specific values used for sorting that need to be calculated based on all manifests from the repo
repoDownloads = 0
@@ -935,7 +935,7 @@ func (dwr *DBWrapper) SearchRepos(ctx context.Context, searchText string, filter
pageFinder.Add(repodb.DetailedRepoMeta{
RepoMeta: repoMeta,
Score: score,
Rank: rank,
Downloads: repoDownloads,
UpdateTime: repoLastUpdated,
})