guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#58136] [PATCH] ui: Improve sort order when searching package names.


From: Ludovic Courtès
Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names.
Date: Sat, 01 Oct 2022 23:42:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> Well, I propose something like see below (based on your patch):
>
>  1. keep the weight as 4
>  2. set the “namespace” weight to 1 (or 2 if you prefer)
>
>     Otherwise, for example, generic name as CSV could artificially bump
>     the relevance and hide relevant packages.  For instance, compare
>
>        guix search csv
>
>  3. use upstream-name if provided

Maybe something like:

  (define %package-metrics
    `((,package-name . 4)
      (,package-upstream-name* . 4)  ;or a lower weight, dunno
      …))

where:

  (define (package-upstream-name* package)
    (or (assoc-ref (package-properties package) 'upstream-name)
        (package-name-sans-namespace package)))  ;strip "r-", "emacs-", etc.

WDYT?

(Perhaps ‘package-upstream-name’ could be taught about these implicit
name conversions done for R, Python, Emacs, etc.?)

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]