feat(search): Add fuzzy name matching and mixed sources (#1719)

* fix(alpm): fix callback text

* feat(yay): Add mixed search result

* remove old result structs

* add option for controlling query builder

* only set query builder after parsing args

* add parser args

* update manpage

* write test for results

* write test for results

* mixed source test

* only sort 1 time with every mode
This commit is contained in:
J Guerreiro
2022-03-06 23:48:15 +00:00
committed by GitHub
parent ae01f8e4a0
commit e4a1f018ea
18 changed files with 628 additions and 148 deletions

View File

@@ -19,9 +19,9 @@ import (
)
// SyncSearch presents a query to the local repos and to the AUR.
func syncSearch(ctx context.Context, pkgS []string, aurClient *aur.Client, dbExecutor db.Executor, verbose bool) error {
queryBuilder := query.NewSourceQueryBuilder(config.SortBy, config.Runtime.Mode, config.SearchBy, config.BottomUp, config.SingleLineResults)
func syncSearch(ctx context.Context, pkgS []string, aurClient *aur.Client,
dbExecutor db.Executor, queryBuilder query.Builder, verbose bool,
) error {
queryBuilder.Execute(ctx, dbExecutor, aurClient, pkgS)
searchMode := query.Minimal
@@ -209,7 +209,8 @@ func statistics(dbExecutor db.Executor) (res struct {
TotalSize int64
pacmanCaches map[string]int64
yayCache int64
}) {
},
) {
for _, pkg := range dbExecutor.LocalPackages() {
res.TotalSize += pkg.ISize()
res.Totaln++