fix(query): improve multi-term search ranking and filtering (#2926)

- Join search terms with space instead of empty separator so Jaro-Winkler
  similarity compares against realistic strings (e.g. 'linux ck' vs 'linuxck')
- Change matchesSearch symbol check from early return to continue so non-symbol
  terms in multi-term queries are still filtered instead of being bypassed
This commit is contained in:
Jo authored and GitHub committed 2026-07-21 21:40:51 +00:00
1 parent 6dad87b015
commit 4a5a0f3d33
1 file changed
+2 -2
+2 -2
View File
@@ -195,7 +195,7 @@ func (s *SourceQueryBuilder) Execute(ctx context.Context, dbExecutor db.Executor
sortableResults := &abstractResults{
results: []abstractResult{},
search: strings.ToLower(strings.Join(pkgS, "")),
search: strings.ToLower(strings.Join(pkgS, " ")),
metric: metric,
separateSources: s.separateSources,
repoOrder: dbExecutor.Repos(),
@@ -341,7 +341,7 @@ func matchesSearch(pkg *aur.Pkg, terms []string) bool {
desc := strings.ToLower(pkg.Description)
for _, pkgN := range terms {
if strings.ContainsFunc(pkgN, unicode.IsSymbol) {
return true
continue
}
targ := strings.ToLower(pkgN)