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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Lars-Dominik Braun <lars@HIDDEN>; Keywords: moreinfo patch; dated Wed, 28 Sep 2022 09:28:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Added tag(s) moreinfo. Request was from Christopher Baines <mail@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 17 Oct 2022 09:31:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 17 05:31:02 2022
Received: from localhost ([127.0.0.1]:47353 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1okMSb-0008C5-P5
	for submit <at> debbugs.gnu.org; Mon, 17 Oct 2022 05:31:02 -0400
Received: from mail-wr1-f53.google.com ([209.85.221.53]:37669)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1okMSZ-0008BT-TH
 for 58136 <at> debbugs.gnu.org; Mon, 17 Oct 2022 05:31:00 -0400
Received: by mail-wr1-f53.google.com with SMTP id bv10so17542516wrb.4
 for <58136 <at> debbugs.gnu.org>; Mon, 17 Oct 2022 02:30:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=VfVCgzLqrQhC1RNY/hKcagmFjrRM9+sW94Z0a3X+t8c=;
 b=iawhRgG+XA4JA1ATykC2j670ztAUV1khHpqbXKeMJkJd7EEcfKVWn9EbMKwZLBk5MG
 cHaGx+T1NEIWBfFE2mEy24NhOgQzNwjOkbM8BUTsVKG9b4mPu8OYIhWhSBqbEbuLXckH
 Vk9v8jb7GHMRweCb4lrHEeMPpIfbtcGLx7J0LR8JNVVX7MwPp/qc4bqT474P+zqvqvBS
 3kCsaclLGrc/bgILL9kyuHVrHTnT6EzccLQ76bmrMNc2iW9LC9IA88/W8ZNx6rVB5yh5
 rwt4Kve1XJ9HJEOTRMBPHi++AYIRf7xPOQn7kG8W5z2a+EKXchwlh08ShEtzdGrcYzA2
 dvWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=VfVCgzLqrQhC1RNY/hKcagmFjrRM9+sW94Z0a3X+t8c=;
 b=lBBS4hBUPo3HdUiQ/adHjOWj+UynAwA2DJ6kcBDK+8txXoox7zlE8GlRFS3DgqnuRw
 kvgLsWrDxhkTqeeuNS6OOZvgtkGcsvR11pIfVXDxIdsA3HQ0Jc8q2Pe48axyEwqcSrDe
 lbWhTad3gLARb5vIOpEA61ohuxY+uFIwDqKdDKvErq+MU8R54/AY8izF09zQ4lwi3tkO
 TokdLuui9ohTRCVOseGv8UwobfFCXnIk8cyyBJi0a1NSSmL3S9F6eyMCZ3NszNwNQ7cQ
 N6HzEox+tr4sGOMbYEQwAg3I+wvu6WFxHquy6ItpdJPA4gQ5fNHLI68MVIox2iKZJdxH
 eVDA==
X-Gm-Message-State: ACrzQf0LqibEg8Owd2FIKx/7+NErLhS3tVACxrZ3FSSHkzcVc9sKMGuD
 AwaKVSNVy0LLH6ep9pjTjb2LreN3/5I=
X-Google-Smtp-Source: AMsMyM6qLZm7IBZekR6zuzYQ61NJfFZ5mGjCrZBhoq7S1qxAKSpvjpDgYZRv8WicNOFgBD2SfTBdcg==
X-Received: by 2002:adf:ec83:0:b0:22e:51e2:7fc7 with SMTP id
 z3-20020adfec83000000b0022e51e27fc7mr5449865wrn.229.1665999053790; 
 Mon, 17 Oct 2022 02:30:53 -0700 (PDT)
Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id
 y3-20020a7bcd83000000b003b492753826sm9461298wmj.43.2022.10.17.02.30.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 17 Oct 2022 02:30:53 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Lars-Dominik Braun
 <ldb@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching
 package names.
In-Reply-To: <8735bmj3jf.fsf_-_@HIDDEN>
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <Y0aj2GRdkZG6cFhs@zpidnb93> <8735bmj3jf.fsf_-_@HIDDEN>
Date: Mon, 17 Oct 2022 10:19:48 +0200
Message-ID: <877d0yoo9n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58136
Cc: 58136 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Lars, Ludo,

In short, I miss why the initial patch with a minor tweak is not enough
for covering the corner cases. :-)


On lun., 17 oct. 2022 at 09:46, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
>> +++ b/guix/ui.scm
>> @@ -1623,10 +1623,23 @@ (define (relevance obj regexps metrics)
>>    (define (score regexp str)
>>      (fold-matches regexp str 0
>>                    (lambda (m score)
>> -                    (+ score
>> -                       (if (string=3D? (match:substring m) str)
>> -                           5             ;exact match
>> -                           1)))))
>> +                    (let* ((start (- (match:start m) 1))
>> +                           (end (match:end m))
>> +                           (left (if (>=3D start 0) (string-ref str sta=
rt) #f))
>> +                           (right (if (< end (string-length str)) (stri=
ng-ref str end) #f))
>> +                           (delimiter-classes '(Cc Cf Pd Pe Pf Pi Po Ps=
 Sk Zs Zl Zp))
>> +                           (delim-left (or (member (and=3D> left char-g=
eneral-category) delimiter-classes) (eq? left #f)))
>> +                           (delim-right (or (member (and=3D> right char=
-general-category) delimiter-classes) (eq? right #f))))
>> +                      (max score
>> +                        (cond
>> +                          ;; regexp is a full match for str.
>> +                          ((and (eq? left #f) (eq? right #f)) 4)
>> +                          ;; regexp matches a single word in str.
>> +                          ((and delim-left delim-right) 3)
>> +                          ;; regexp matches the beginning or end of a w=
ord in str.
>> +                          ((or delim-left delim-right) 2)
>> +                          ;; Everything else.
>> +                          (#t 1)))))))
>
> The intent is to have all regexps behave as if the user passed \<STR\>,
> is that right?  Would be nice to have a comment clarifying that above
> and perhaps making it a separate change?

All this appears to me overcomplicated.  Personally, I have to read it
many times to get the logic; while the initial patch was much clearer,
IMHO.

Other said, I am not convinced the complexity is worth the corner case.


The initial patch with the minor tweak I am proposing (maybe using
package-upstream-name*) appears to me enough for covering the corner
cases initially reported (as ggplot2).


>> @@ -1635,10 +1648,11 @@ (define (regexp->score regexp)
>>                  ((field . weight)
>>                   (match (field obj)
>>                     (#f  relevance)
>> +                   ('() relevance)
>>                     ((? string? str)
>> -                    (+ relevance (* (score-regexp str) weight)))
>> +                    (max relevance (* (score-regexp str) weight)))
>>                     ((lst ...)
>> -                    (+ relevance (* weight (apply + (map score-regexp l=
st)))))))))
>> +                    (max relevance (* weight (apply max (map score-rege=
xp lst)))))))))
>
> Intuitively I would expect scores to add up, otherwise we=E2=80=99re kinda
> losing information; so I would not make this change.  WDYT?

I agree with Ludo that =E2=80=99max=E2=80=99 is counterintuitive.


Well, could we list some examples (keyword and expectation)?  Because
the initial patch with a minor tweak LGTM and covers ggplot2, csv, and
some others.


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 17 Oct 2022 07:46:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 17 03:46:46 2022
Received: from localhost ([127.0.0.1]:47095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1okKpi-0002tu-Ak
	for submit <at> debbugs.gnu.org; Mon, 17 Oct 2022 03:46:46 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41758)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1okKpY-0002tU-Qv
 for 58136 <at> debbugs.gnu.org; Mon, 17 Oct 2022 03:46:44 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44680)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1okKpT-0004AV-Dx; Mon, 17 Oct 2022 03:46:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=pfGgB/5PdQvGBe2B8ocanGYNcy8t+NYFsPmYNLL4jeA=; b=EkQshrDvSmJzP5THnbTf
 yqZFTUsBzYhjOpwYTcOhJZhC0GgEO1qem+mTaMXHRf7Pgx3r/FMn69X/4cqpPgxYVftwAgoaio2lS
 muZ/Fph9hgSBy1EVPm1TUL+qHO228rwK+DVnzujY/2PvVdc0FDccDaD1sg0VO664mjV0ID614FlcW
 SZD7YqesceN6GQ8Z9axRcmaZnct+wYkq3riUncJOqCXgMyrsjdDocWhwmqjWeUKTs5P39xs5SHBvl
 CBsQBvNmlttce/nMFASx+oz5uoZpWHf1c5Jam9nJE7ay2nPDCKV3pHwtC4oYFkCRzzoneTbP1sKmc
 92BIUf3VkgClCQ==;
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=52172 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1okKpS-0007dy-Oj; Mon, 17 Oct 2022 03:46:30 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Lars-Dominik Braun <ldb@HIDDEN>
Subject: Re: bug#58136: [PATCH] ui: Improve sort order when searching
 package names.
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <Y0aj2GRdkZG6cFhs@zpidnb93>
Date: Mon, 17 Oct 2022 09:46:28 +0200
In-Reply-To: <Y0aj2GRdkZG6cFhs@zpidnb93> (Lars-Dominik Braun's message of
 "Wed, 12 Oct 2022 13:24:08 +0200")
Message-ID: <8735bmj3jf.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58136
Cc: 58136 <at> debbugs.gnu.org, zimoun <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

Lars-Dominik Braun <ldb@HIDDEN> skribis:

> diff --git a/guix/packages.scm b/guix/packages.scm
> index 94e464cd01..9934501cdb 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -86,6 +86,7 @@ (define-module (guix packages)
>              this-package
>              package-name
>              package-upstream-name
> +            package-upstream-name*
>              package-version
>              package-full-name
>              package-source
> @@ -657,6 +658,38 @@ (define (package-upstream-name package)
>    (or (assq-ref (package-properties package) 'upstream-name)
>        (package-name package)))
>=20=20
> +(define (package-upstream-name* package)
> +  "Return the upstream name of PACKAGE, which could be different from th=
e name
> +it has in Guix."

s/which could.*Guix/accounting for commonly-used package name prefixes
in addition to the @code{upstream-name} property/

Preferably make this addition in a separate commit.

> +++ b/guix/ui.scm
> @@ -1623,10 +1623,23 @@ (define (relevance obj regexps metrics)
>    (define (score regexp str)
>      (fold-matches regexp str 0
>                    (lambda (m score)
> -                    (+ score
> -                       (if (string=3D? (match:substring m) str)
> -                           5             ;exact match
> -                           1)))))
> +                    (let* ((start (- (match:start m) 1))
> +                           (end (match:end m))
> +                           (left (if (>=3D start 0) (string-ref str star=
t) #f))
> +                           (right (if (< end (string-length str)) (strin=
g-ref str end) #f))
> +                           (delimiter-classes '(Cc Cf Pd Pe Pf Pi Po Ps =
Sk Zs Zl Zp))
> +                           (delim-left (or (member (and=3D> left char-ge=
neral-category) delimiter-classes) (eq? left #f)))
> +                           (delim-right (or (member (and=3D> right char-=
general-category) delimiter-classes) (eq? right #f))))
> +                      (max score
> +                        (cond
> +                          ;; regexp is a full match for str.
> +                          ((and (eq? left #f) (eq? right #f)) 4)
> +                          ;; regexp matches a single word in str.
> +                          ((and delim-left delim-right) 3)
> +                          ;; regexp matches the beginning or end of a wo=
rd in str.
> +                          ((or delim-left delim-right) 2)
> +                          ;; Everything else.
> +                          (#t 1)))))))

The intent is to have all regexps behave as if the user passed \<STR\>,
is that right?  Would be nice to have a comment clarifying that above
and perhaps making it a separate change?

Stylistic notes:

  (if cond consequent #f)  =3D>  (and cond consequent)
  (eq? x #f)               =3D>  (not x)
  (cond =E2=80=A6 (#t x))          =3D>  (cond =E2=80=A6 (else x))

> @@ -1635,10 +1648,11 @@ (define (regexp->score regexp)
>                  ((field . weight)
>                   (match (field obj)
>                     (#f  relevance)
> +                   ('() relevance)
>                     ((? string? str)
> -                    (+ relevance (* (score-regexp str) weight)))
> +                    (max relevance (* (score-regexp str) weight)))
>                     ((lst ...)
> -                    (+ relevance (* weight (apply + (map score-regexp ls=
t)))))))))
> +                    (max relevance (* weight (apply max (map score-regex=
p lst)))))))))

Intuitively I would expect scores to add up, otherwise we=E2=80=99re kinda
losing information; so I would not make this change.  WDYT?

There=E2=80=99s a test for =E2=80=98package-relevance=E2=80=99 in tests/ui.=
scm.  Please make
sure it still passes and ideally add relevant tests such as the CSV
example you gave.

Thanks!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 12 Oct 2022 11:24:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 12 07:24:18 2022
Received: from localhost ([127.0.0.1]:55899 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oiZqU-0000Ex-0U
	for submit <at> debbugs.gnu.org; Wed, 12 Oct 2022 07:24:18 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:34467)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ldb@HIDDEN>) id 1oiZqS-0000El-2v
 for 58136 <at> debbugs.gnu.org; Wed, 12 Oct 2022 07:24:16 -0400
Received: by mail-wr1-f51.google.com with SMTP id b4so25784466wrs.1
 for <58136 <at> debbugs.gnu.org>; Wed, 12 Oct 2022 04:24:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=leibniz-psychology-org.20210112.gappssmtp.com; s=20210112;
 h=in-reply-to:content-disposition:mime-version:references:message-id
 :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
 bh=MrfnaiYkrXg/oz6p3rCZ467AMtTMt5CjEXJzoyzHU1M=;
 b=O2MTMSq+BPERh4/auVY34PTalkgEcPEzJpiGeT3xWzcJRMGbQSWDZOxUWGNRx0EPVT
 mYMJyFXvsMBZt6CXlErY7eM3Asz4ZwxIxnUxghv6nfiMv3XLriOegX2Ul2XjTUkL8ak0
 Zvt4i1JMq4ihKubYgI+rW1198W/7pWOEGeIcBUjv+cL5g24TwKhKNe4ezB5y41l0TpN+
 bE0DhmuSMLdR4D3kpX9X3vOQLn+BQAngWotdlf1x93sMImdkiJPWzD341kis/cjium5Q
 qNGrpGA0lCc5QLriBqwB3CmwRvwfwHPYlwfDbMRsWA/8cWHKScg/zXjuZSnDoM8zgKwm
 JW/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=in-reply-to:content-disposition:mime-version:references:message-id
 :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=MrfnaiYkrXg/oz6p3rCZ467AMtTMt5CjEXJzoyzHU1M=;
 b=6bVH05uMy9+is01b7JgjWviHRwCI+2Tcgw8IeHnLJ0C2mk4Mdr1BmELO97tsHb1pTP
 daj4wjky2/8mOy63PRFYpcp/wWPzBkwgaogx3GRhp40XyNMzr7e27QxCTZc6zfBepZ+O
 rtPrNBNXQXnTJsYSRQcdLLxKf9ZGqFjQoR0opzsZvAUPbGM7oB4Dt9P/yaKZUgK3DKAX
 Xf68HlOpEVMlXAyf0nyWP3sLk2Gn9ZUA2NL1Q0HLad93QM2cjIvMKzqe3epqJqogjb3Z
 oLBNLKPf3eOwFL19ayiiika26/nOph6TZoGi1p54/lY/2Cnccxc+RnOrmtOAtohca6Pf
 abmQ==
X-Gm-Message-State: ACrzQf2s40Yf3BnJQTFZDkOc10yXThga9dG342P0yVNUxdSLB2Zfm31H
 EbCLab6FT5p0irevn38y7HEDJJxr3BIw3n+xa/T5kRuPhyyr3w6EAreJ3WLvS3O76l5rIbNoRvm
 dPLrW8bfxHBP2TU3b3lUsyS8Hwg2yf4irlnRkxMnUbISKY+YwGacXMG0rYokC3g3OeS70zFfDtH
 7UbHE=
X-Google-Smtp-Source: AMsMyM48etzAk6iiUFVBA50abfDNao+EMp5IfPQoQJfkVDkVsAKIV06BVALMRyk62GGJOUDb7N6K0w==
X-Received: by 2002:a05:6000:788:b0:22e:412b:7959 with SMTP id
 bu8-20020a056000078800b0022e412b7959mr17943239wrb.491.1665573849958; 
 Wed, 12 Oct 2022 04:24:09 -0700 (PDT)
Received: from localhost (opensense.uni-trier.de. [136.199.1.50])
 by smtp.gmail.com with ESMTPSA id
 g17-20020a05600c001100b003c6bbe910fdsm1877617wmc.9.2022.10.12.04.24.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Oct 2022 04:24:09 -0700 (PDT)
Date: Wed, 12 Oct 2022 13:24:08 +0200
From: Lars-Dominik Braun <ldb@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching
 package names.
Message-ID: <Y0aj2GRdkZG6cFhs@zpidnb93>
References: <YzQTieJZSCJGTGY2@HIDDEN>
 <86wn9na82p.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="1WUFmoobFniE+iSj"
Content-Disposition: inline
In-Reply-To: <86wn9na82p.fsf@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58136
Cc: ludo@HIDDEN, 58136 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--1WUFmoobFniE+iSj
Content-Type: multipart/mixed; boundary="6l9BvxkPFUTZKg+P"
Content-Disposition: inline


--6l9BvxkPFUTZKg+P
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi simon,

> In addition to your proposal which LGTM, maybe we could also use the
> =E2=80=99upstream-name=E2=80=99 properties.  Most of the time, the Guix n=
ame matches the
> upstream name, but sometimes not.  Although, it would not fix the issue
> for ggplot2 since there is no upstream-name for this package. :-)
I agree that using the upstream-name would be a good idea.

>  2. set the =E2=80=9Cnamespace=E2=80=9D weight to 1 (or 2 if you prefer)
>=20
>     Otherwise, for example, generic name as CSV could artificially bump
>     the relevance and hide relevant packages.  For instance, compare
>=20
>        guix search csv
The issue here is we don=E2=80=99t know what the user is searching for. If =
we
add more weight to the package name then usually libraries (rust-csv,
ghc-csv, =E2=80=A6) win. Imo a search for =E2=80=9Ccsv=E2=80=9D should retu=
rn tools to
manipulate CSV files like csvkit, csvdiff, xlsx2csv, =E2=80=A6 Just like
=E2=80=9Cjson=E2=80=9D should yield tools like jq, json.sh and possibly oth=
ers which
I cannot find right now. But maybe I=E2=80=99m searching for a C library th=
at
parses CSV instead. And then what=E2=80=A6?

As for ggplot2, the particular issue seems to be that scores are added
for each match and the description for some of our packages contains
=E2=80=9Cggplot2=E2=80=9D alot. So I tried using MAX instead of +, which wo=
rks,
but results in little variation of scores and thus weird sort order
(descending by name). It does not feel like an improvement either.

Cheers,
Lars

--=20
Lars-Dominik Braun
Wissenschaftlicher Mitarbeiter/Research Associate

www.leibniz-psychology.org
ZPID - Leibniz-Institut f=C3=BCr Psychologie /
ZPID - Leibniz Institute for Psychology
Universit=C3=A4tsring 15
D-54296 Trier - Germany
Tel.: +49=E2=80=93651=E2=80=93201-4964

--6l9BvxkPFUTZKg+P
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="v2.patch"
Content-Transfer-Encoding: quoted-printable

diff --git a/guix/packages.scm b/guix/packages.scm
index 94e464cd01..9934501cdb 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -86,6 +86,7 @@ (define-module (guix packages)
             this-package
             package-name
             package-upstream-name
+            package-upstream-name*
             package-version
             package-full-name
             package-source
@@ -657,6 +658,38 @@ (define (package-upstream-name package)
   (or (assq-ref (package-properties package) 'upstream-name)
       (package-name package)))
=20
+(define (package-upstream-name* package)
+  "Return the upstream name of PACKAGE, which could be different from the =
name
+it has in Guix."
+  (let ((namespaces (list "cl-"
+                          "ecl-"
+                          "emacs-"
+                          "ghc-"
+                          "go-"
+                          "guile-"
+                          "java-"
+                          "julia-"
+                          "lua-"
+                          "minetest-"
+                          "node-"
+                          "ocaml-"
+                          "perl-"
+                          "python-"
+                          "r-"
+                          "ruby-"
+                          "rust-"
+                          "sbcl-"
+                          "texlive-"))
+        (name (package-name package)))
+    (or (assq-ref (package-properties package) 'upstream-name)
+        (let loop ((prefixes namespaces))
+          (match prefixes
+            ('() name)
+            ((prefix rest ...)
+              (if (string-prefix? prefix name)
+                (substring name (string-length prefix))
+                (loop (cdr prefixes)))))))))
+
 (define (hidden-package p)
   "Return a \"hidden\" version of P--i.e., one that 'fold-packages' and th=
us,
 user interfaces, ignores."
diff --git a/guix/ui.scm b/guix/ui.scm
index dad2b853ac..da16a50f9f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1623,10 +1623,23 @@ (define (relevance obj regexps metrics)
   (define (score regexp str)
     (fold-matches regexp str 0
                   (lambda (m score)
-                    (+ score
-                       (if (string=3D? (match:substring m) str)
-                           5             ;exact match
-                           1)))))
+                    (let* ((start (- (match:start m) 1))
+                           (end (match:end m))
+                           (left (if (>=3D start 0) (string-ref str start)=
 #f))
+                           (right (if (< end (string-length str)) (string-=
ref str end) #f))
+                           (delimiter-classes '(Cc Cf Pd Pe Pf Pi Po Ps Sk=
 Zs Zl Zp))
+                           (delim-left (or (member (and=3D> left char-gene=
ral-category) delimiter-classes) (eq? left #f)))
+                           (delim-right (or (member (and=3D> right char-ge=
neral-category) delimiter-classes) (eq? right #f))))
+                      (max score
+                        (cond
+                          ;; regexp is a full match for str.
+                          ((and (eq? left #f) (eq? right #f)) 4)
+                          ;; regexp matches a single word in str.
+                          ((and delim-left delim-right) 3)
+                          ;; regexp matches the beginning or end of a word=
 in str.
+                          ((or delim-left delim-right) 2)
+                          ;; Everything else.
+                          (#t 1)))))))
=20
   (define (regexp->score regexp)
     (let ((score-regexp (lambda (str) (score regexp str))))
@@ -1635,10 +1648,11 @@ (define (regexp->score regexp)
                 ((field . weight)
                  (match (field obj)
                    (#f  relevance)
+                   ('() relevance)
                    ((? string? str)
-                    (+ relevance (* (score-regexp str) weight)))
+                    (max relevance (* (score-regexp str) weight)))
                    ((lst ...)
-                    (+ relevance (* weight (apply + (map score-regexp lst)=
))))))))
+                    (max relevance (* weight (apply max (map score-regexp =
lst)))))))))
             0 metrics)))
=20
   (let loop ((regexps regexps)
@@ -1655,7 +1669,8 @@ (define (regexp->score regexp)
 (define %package-metrics
   ;; Metrics used to compute the "relevance score" of a package against a =
set
   ;; of regexps.
-  `((,package-name . 4)
+  `((,package-name . 5)
+    (,package-upstream-name* . 1)
=20
     ;; Match against uncommon outputs.
     (,(lambda (package)

--6l9BvxkPFUTZKg+P--

--1WUFmoobFniE+iSj
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAmNGo8wACgkQQhN3ARo3
hEba5gv+ILcz/1yKN1+6IUZ4SaSfwURreKttay/0O7uTVddFMAfOmkryx4SOfLoN
0fpmhpJ93nF7TYkaUBelvTSOmrb0bZa63OgxfOxLc4DoDRjAY+F7bY2Oa9HvRM1r
dCuHh/Fob7JvVFy9Z8jA5iqmnICrUcNgJnh1TI8xNybY+g+1nvLhyKwWH5+ZjtDt
J9r60nDeisxk8Dkoub3mxJbILBymjscviPWRoA0iwY0//KZv3JIRl4ICufqGMil0
S2TkL5vpzVYtCLfhyvv33rKNkXjj5bHGy6Cy94psVkVo3v0wIf5JS5mJGpYv3wEP
wTp74j7dd1wnZgwhjlK3hUXBnm/vwBPOJxTYdH0VGUjxmqFcGJ7Hm6tYWv++3Zbz
x5BK6l3dgXCNgcNf5yUShRncpVLHyeOnjQ/Lv6i64pKaPxRpVkCXO66uyTpc+lgq
WDLbjmKjq8nTiokwfRtFMNspwjquhlju4C5NXsM21WQJ916TOotSRmVlONKQvdh4
whHkNPMm
=Ji6J
-----END PGP SIGNATURE-----

--1WUFmoobFniE+iSj--




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 2 Oct 2022 09:04:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 02 05:04:32 2022
Received: from localhost ([127.0.0.1]:46269 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oeutj-0003Yg-Vy
	for submit <at> debbugs.gnu.org; Sun, 02 Oct 2022 05:04:32 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:40893)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1oeuti-0003YT-39
 for 58136 <at> debbugs.gnu.org; Sun, 02 Oct 2022 05:04:30 -0400
Received: by mail-wr1-f43.google.com with SMTP id w18so4060850wro.7
 for <58136 <at> debbugs.gnu.org>; Sun, 02 Oct 2022 02:04:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=Nd+OB9e1+bveulQgSSYC4UeyobiYmW5QjT8Wqvdfssc=;
 b=f4skjdU15iLyhjckbCf+WsHaJ5SH0dNNCxjDRAXJGWLRNa4gzVuan0ASMEyRj4itid
 jKh8kHSpvXsI/6zl+rbpTof0eq+aNYMS4B5xzNhE4Fomy4VBp1iT58zp+EjvZtAU3bmY
 Xd5G2PmEKwo172iQFxagErBRlEEipavUUHhk9sNtrf0v7/NE7Y9iI02M6IOHU0i+ijZm
 /FbRxhBtGqtQu/G9iWkJ1UE1OupYacYDDeTZs2th7WNl7CYsrPgPtI1IMkgf4xRb9dDt
 7siUmOus4JtUGomLz4jDl8D3hXSNbtLd/HZ/JyeIBkKVQIH9oxpV/oPNjD7FwZZce/eE
 K+Vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date;
 bh=Nd+OB9e1+bveulQgSSYC4UeyobiYmW5QjT8Wqvdfssc=;
 b=zaPXViPXWZ9si+fbzXVYgC/F5Bds76cQ1itQrxNzBWo3qe0MKNWazZNjrgWRM7Mr8w
 qoMwBbDfhD3lookmF2DfBtoGHRygTKTjGso+tuHJ6dcW6LifKqc2elGDdHvb/uWlVVI8
 c3pFua94D9xJqjIAnmcaz7nNm852F7mkw4tnpNWl3U8i8NWeMU0Y62gZMUbPZ/+c+fLc
 moZ47poDJ4RJ/le0WGizBE3QTJT4P0XgwvTaTWzWtxe6q9r5/A94xlRUF43QPawEYtrM
 TaFgdzvsWcy0hAwakWK2K7OCxkGAjMOwH9OJm1/x9AprZm7Balfp3IGSYyIO0g/Li/cv
 itaQ==
X-Gm-Message-State: ACrzQf3vV1UCZ94tv2qnCVxln7HZCQcUP3kKvYAny342Cpx2KaulLhEd
 0QwWk6+JBUrGKaFfzqJflLU=
X-Google-Smtp-Source: AMsMyM5Or/IAy11k0EOHchpk/zt5y20UHzwy+A1f03P4VtLnIVl6W0rylxdUWtkxMZmFRRv6wg43Pg==
X-Received: by 2002:adf:d0d0:0:b0:22d:f735:4730 with SMTP id
 z16-20020adfd0d0000000b0022df7354730mr6136288wrh.297.1664701464134; 
 Sun, 02 Oct 2022 02:04:24 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 bh14-20020a05600c3d0e00b003b47575d304sm10582562wmb.32.2022.10.02.02.04.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 02 Oct 2022 02:04:23 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching
 package names.
In-Reply-To: <87v8p3b4pt.fsf@HIDDEN>
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <87v8p3b4pt.fsf@HIDDEN>
Date: Sun, 02 Oct 2022 10:26:26 +0200
Message-ID: <868rly3a31.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58136
Cc: Lars-Dominik Braun <lars@HIDDEN>, 58136 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Sat, 01 Oct 2022 at 23:42, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

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

I think it is better to rely on =E2=80=99package-upstream-name=E2=80=99 and=
 hides the
plumbing.  It helps when something needs to be =E2=80=9Crefactored=E2=80=9C=
, IMHO.


> (Perhaps =E2=80=98package-upstream-name=E2=80=99 could be taught about th=
ese implicit
> name conversions done for R, Python, Emacs, etc.?)

Maybe, but it requires to scrutinize importer per importer since
upstream name is mainly used by these, IIUC.


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 1 Oct 2022 21:43:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 01 17:43:06 2022
Received: from localhost ([127.0.0.1]:45785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oekGI-00037u-79
	for submit <at> debbugs.gnu.org; Sat, 01 Oct 2022 17:43:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59182)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1oekGG-00037Q-I1
 for 58136 <at> debbugs.gnu.org; Sat, 01 Oct 2022 17:43:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43310)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1oekGA-0006fQ-29; Sat, 01 Oct 2022 17:42:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=NZPie+A1d6iTPeV+dpzLtwoGzl1JPNTevesa09OpInw=; b=cS2n5+iVAYzmUje2hZCo
 gvmixUm/lpgaxXnd8KGumpl4eiKpW72BEOVPz5yrAaSz2lhOL+Je+xXyqjER2Mf/lVp8sQjyiDQnX
 CXRerDKTVOGDpEbUOCo/6P5wv8/aGjokeId0bFYh7MXRDUUgbAHHNh34WY3O+1cK5QlgIqCedpcvh
 h+g+S8s6K22AwZD1SxVo/nlfjC369A2dqgWuvAZ8wkA6mbJLw+CRezKy4/3znz9hUVP0UWoJUNZFR
 7BKF3IeMt7RoB9VurBsz1CzVnZTg/LL5T8fDRfpQOLKSzlv5hOjMn5mCz9fz8xPI4SFseDiJXib0i
 MTa08m+UoDcFnQ==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60260
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1oekG9-0002Z5-Es; Sat, 01 Oct 2022 17:42:57 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching
 package names.
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 10 =?utf-8?Q?Vend=C3=A9miair?=
 =?utf-8?Q?e?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de
 la Cuve
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Sat, 01 Oct 2022 23:42:54 +0200
In-Reply-To: <86wn9na82p.fsf@HIDDEN> (zimoun's message of "Wed, 28 Sep 2022
 16:26:38 +0200")
Message-ID: <87v8p3b4pt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 58136
Cc: 58136 <at> debbugs.gnu.org, Lars-Dominik Braun <lars@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

zimoun <zimon.toutoune@HIDDEN> skribis:

> Well, I propose something like see below (based on your patch):
>
>  1. keep the weight as 4
>  2. set the =E2=80=9Cnamespace=E2=80=9D 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
      =E2=80=A6))

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 =E2=80=98package-upstream-name=E2=80=99 could be taught about thes=
e implicit
name conversions done for R, Python, Emacs, etc.?)

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 21:43:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 28 17:43:52 2022
Received: from localhost ([127.0.0.1]:35080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1odeqO-0007dU-5v
	for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 17:43:52 -0400
Received: from baptiste.telenet-ops.be ([195.130.132.51]:50800)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1odeqM-0007dL-N6
 for 58136 <at> debbugs.gnu.org; Wed, 28 Sep 2022 17:43:51 -0400
Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]
 ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16])
 by baptiste.telenet-ops.be with bizsmtp
 id RZjl2800820ykKC01Zjl2u; Wed, 28 Sep 2022 23:43:48 +0200
Message-ID: <4dc4d1e1-9775-5c29-877f-91022b794348@HIDDEN>
Date: Wed, 28 Sep 2022 23:43:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.12.0
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package
 names.
Content-Language: en-US
To: zimoun <zimon.toutoune@HIDDEN>, Lars-Dominik Braun <lars@HIDDEN>,
 58136 <at> debbugs.gnu.org
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN> <87v8p7b2kt.fsf@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
In-Reply-To: <87v8p7b2kt.fsf@HIDDEN>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------6goxKr2BsWNzD5hKx6c82YLb"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1664401428; bh=ft25LErALfuCYhbyDZL3hqv3oRkj8vFtTfZfOf2o+AQ=;
 h=Date:Subject:To:Cc:References:From:In-Reply-To;
 b=GBPpUOWdVG5QKfqGQXWakE5WxpcphJeIGmimEaXjVaLXC1cL+sxg+a0nL47zfy11r
 DGWYdpvQq6MX8lUDnPf2jHYVR2B+GPvu7w9U6r041nmi+Ls6Nr2cwjBzw3jjLIArxm
 +u/8u9N3YxXy16TA31WBLuLnVBBSVt00QZ+nfCFbinzUkq18kO2rsawXMW9fM/3cue
 qI7vYYUma3QrOQ2HyP0OS4Lvusz0kDFREEiTUJPq5sYU8putFwNrOrcRMK8DEk3anx
 3U6zrsrliZOhJwsdMr4zN3B95foMvMOPucbRyT8BbfbpQZAw1Tr/RQH09v/ccGGlTd
 ndG1ywDjrRWCQ==
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 58136
Cc: ludo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.5 (---)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------6goxKr2BsWNzD5hKx6c82YLb
Content-Type: multipart/mixed; boundary="------------RXSSOzE309XksWnSvw90W6C8";
 protected-headers="v1"
From: Maxime Devos <maximedevos@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>, Lars-Dominik Braun <lars@HIDDEN>,
 58136 <at> debbugs.gnu.org
Cc: ludo@HIDDEN
Message-ID: <4dc4d1e1-9775-5c29-877f-91022b794348@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package
 names.
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN> <87v8p7b2kt.fsf@HIDDEN>
In-Reply-To: <87v8p7b2kt.fsf@HIDDEN>

--------------RXSSOzE309XksWnSvw90W6C8
Content-Type: multipart/mixed; boundary="------------BmkWTnOHs6Z78LzH2OjEtjTw"

--------------BmkWTnOHs6Z78LzH2OjEtjTw
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

DQoNCk9uIDI4LTA5LTIwMjIgMjM6NDAsIHppbW91biB3cm90ZToNCj4gVXNpbmcgdGhlIGNo
YW5nZSBJIGFtIHByb3Bvc2luZywganVzdCBrbm93aW5nIOKAmWplaWph4oCZIHJldHVybnMg
YSBtYXRjaDoNCj4gDQo+IC0tODwtLS0tLS0tLS0tLS0tLS1jdXQgaGVyZS0tLS0tLS0tLS0t
LS0tLXN0YXJ0LS0tLS0tLS0tLS0tLT44LS0tDQo+ICQgLi9wcmUtaW5zdC1lbnYgZ3VpeCBz
ZWFyY2ggamVpamENCj4gbmFtZTogbWluZXRlc3QtbWVzZWNvbnMNCiA+IFsuLi5dDQoNClJp
Z2h0LCBkaWRuJ3QgdGhpbmsgb2YgdGhhdC4NCg0KR3JlZXRpbmdzLA0KTWF4aW1lLg0K
--------------BmkWTnOHs6Z78LzH2OjEtjTw
Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc"
Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m
xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2
ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL
CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc
/gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4
LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C
kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK
CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W
ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ
Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0
k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo
AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE
fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D
=3DOVqp
-----END PGP PUBLIC KEY BLOCK-----

--------------BmkWTnOHs6Z78LzH2OjEtjTw--

--------------RXSSOzE309XksWnSvw90W6C8--

--------------6goxKr2BsWNzD5hKx6c82YLb
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYzTAEQUDAAAAAAAKCRBJ4+4iGRcl7qGk
AQD3uSy7u3zAJ9N9Z9jKVkH4ortcw0Vk2MIJZQiEWMYBPAEAxllvXhMZjx5yGxBcadLb0t9iA0Fm
ZnPojYW2P6uT0ws=
=eN9x
-----END PGP SIGNATURE-----

--------------6goxKr2BsWNzD5hKx6c82YLb--




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 21:40:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 28 17:40:17 2022
Received: from localhost ([127.0.0.1]:35066 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1odemv-0007XR-GL
	for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 17:40:17 -0400
Received: from mail-wm1-f50.google.com ([209.85.128.50]:43529)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1odemr-0007X8-6h
 for 58136 <at> debbugs.gnu.org; Wed, 28 Sep 2022 17:40:15 -0400
Received: by mail-wm1-f50.google.com with SMTP id
 r3-20020a05600c35c300b003b4b5f6c6bdso1702104wmq.2
 for <58136 <at> debbugs.gnu.org>; Wed, 28 Sep 2022 14:40:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=wIeAGmfme+/k658scHTgXTUyTswPpM9bJyZcCoJ9I/c=;
 b=DIx5LV64dhK2yfFg7FcO18SsAajr1RVR0iL9Fp/bB/tWsRcOpI1t50w0+wJBkEfi0r
 bImfuDvYAW4vnL7lvN57DrBYwBtnjhY/zsFJR2ev4Isoh3H/O5tUcxAgQGEm03jr6GFZ
 KWX/K32+olzsh3meugcDnykX5Ms0DihQ91XCKFHddIx7ittgJeQ15VDgCo6aurDIEUOf
 BRHX66e1JpyhLoN6Sl6v5rqVQRWBSOeM0Ixn4tpgR03poaMOI1V+6vvm76RbZ+QhvBG3
 /+14K8QjfZ2t6A2znkK6CvaA15gPOcuHwpHYJBG5ReU4Y3X8HdIDnN5/ck2L4uW8xqwQ
 9zEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date;
 bh=wIeAGmfme+/k658scHTgXTUyTswPpM9bJyZcCoJ9I/c=;
 b=GX9X6zQRI3Gipwfgeq7iS54++fDb3wOnIMMJ4YX6KFfcYsIvMutFyNKkdn7QpxXt1b
 PS8Y+re5LUZiFsXJI/irLWdzcy0FUSnU7HBAYBzXoOm8gsYpoQyjbGCKcfDT3XNd2dCB
 Wk2ax5p+WWhA5ATEZA5zFOHOVVKQnujtLYT1xihncbJnso22OYv2FcwlGe7r8tMlm2nG
 fGvOGIgsvXIXn5Xy8RZyx+vP/8I0vwZJNhy+lO9jfOTyhyuF44LITaJD0Gb1J7fHYIuI
 PvghV4gOzrsnDKx3fusW05E6aXoWOEsiOygQIMAY/HArNxR2II9wgAKobS1wr/GQzIoA
 t+Cw==
X-Gm-Message-State: ACrzQf09FdAoYVWemXx0WbHrGlEkE7MLgPuDJ7lye1Mj7o6EuDsYlAlM
 4c2fCyes7qqr9Bwf5Un4weU=
X-Google-Smtp-Source: AMsMyM5AX4xCIPBuTdd+w9Lwe/ZCHN3+GKe4NJifzKI4KRRTvQEj1tqzHvWb3lM1HWL1x7Qvq7Ks1Q==
X-Received: by 2002:a7b:cc96:0:b0:3b4:ffb5:6366 with SMTP id
 p22-20020a7bcc96000000b003b4ffb56366mr36600wma.48.1664401207169; 
 Wed, 28 Sep 2022 14:40:07 -0700 (PDT)
Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id
 q4-20020adf9dc4000000b0022cce7689d3sm765243wre.36.2022.09.28.14.40.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Sep 2022 14:40:06 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>, Lars-Dominik Braun
 <lars@HIDDEN>, 58136 <at> debbugs.gnu.org
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching
 package names.
In-Reply-To: <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
Date: Wed, 28 Sep 2022 23:40:02 +0200
Message-ID: <87v8p7b2kt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58136
Cc: ludo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On mer., 28 sept. 2022 at 22:23, Maxime Devos <maximedevos@HIDDEN> wrot=
e:

> On 28-09-2022 16:26, zimoun wrote:
>>   3. use upstream-name if provided
>
> For the Minetest mods (which have upstream-names like "Jeija/mesecons"),=
=20
> I don't think think the upstream-name is useful as-is

Using the change I am proposing, just knowing =E2=80=99jeija=E2=80=99 retur=
ns a match:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix search jeija
name: minetest-mesecons
version: 1.2.1-63.27c3c51
outputs:
+ out: everything else
systems: x86_64-linux
dependencies:=20
location: gnu/packages/minetest.scm:367:4
homepage: https://mesecons.net
license: LGPL 3, CC-BY-SA 3.0
synopsis: Digital circuitry for Minetest, including wires, buttons and ligh=
ts=20=20
description: Mesecons is a mod for Minetest implementing various items
+ related to digital circuitry, such as wires, buttons, lights and programm=
able
+ controllers.  Among other things, there are also pistons, solar panels,
+ pressure plates and note blocks.
+=20
+ Mesecons has a similar goal to Redstone in Minecraft, but works in its own
+ way, with different rules and mechanics.
relevance: 4
--8<---------------cut here---------------end--------------->8---

which is better than nothing.

Well, upstream-name is not so much useful as-is but it can help for some
cases.


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 20:45:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 28 16:45:45 2022
Received: from localhost ([127.0.0.1]:34920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oddw9-0003lm-59
	for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 16:45:45 -0400
Received: from baptiste.telenet-ops.be ([195.130.132.51]:36516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1oddw4-0003Vt-QB
 for 58136 <at> debbugs.gnu.org; Wed, 28 Sep 2022 16:45:41 -0400
Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]
 ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16])
 by baptiste.telenet-ops.be with bizsmtp
 id RYle2800G20ykKC01Ylfxw; Wed, 28 Sep 2022 22:45:39 +0200
Message-ID: <cbbf0372-39e0-c9e5-d24f-89b6e0d1c9bb@HIDDEN>
Date: Wed, 28 Sep 2022 22:45:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.12.0
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package
 names.
Content-Language: en-US
From: Maxime Devos <maximedevos@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>, Lars-Dominik Braun <lars@HIDDEN>,
 58136 <at> debbugs.gnu.org
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
In-Reply-To: <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Rr0OzhZA9osOVmGVcy7lbzUH"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1664397939; bh=X/k8pwZAU0ujMo3X+w7jHQ2GvJSxGTN09QYZwVsyX1w=;
 h=Date:Subject:From:To:Cc:References:In-Reply-To;
 b=eSzIeyScgi6dqHGxENbfWB+yI9rIJfANj/uMqa3wNn4ZY33dQudm1f5bOKr0eKan8
 96Q8LcRaQIVH3EO3DZ2WDMGMYAWkYW1M3J6YTRNIQSmvtmw2VGLahqeug41bEcWfwG
 E7W5zwqOHa4u6m+g40TwFY+wNlSytLK+qau/235IjEzeCxF6UHkA+mIDetm1S7UwR9
 My6oQeXmepUMoXRfN3hhVxyxA4DbraNx+8AbUQU/59iIav/mEAtbPCmPCka4yHRMt4
 lU5yVDLpNAFQD4pJjFikopXgJhBuha1PBXzLn49bby7UD57HAw65wun3GQ0HTDdRjS
 dTwMKY9Hwq5zg==
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 58136
Cc: ludo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.5 (---)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Rr0OzhZA9osOVmGVcy7lbzUH
Content-Type: multipart/mixed; boundary="------------qCjG6e6Sf4oavodlIjtFAxbt";
 protected-headers="v1"
From: Maxime Devos <maximedevos@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>, Lars-Dominik Braun <lars@HIDDEN>,
 58136 <at> debbugs.gnu.org
Cc: ludo@HIDDEN
Message-ID: <cbbf0372-39e0-c9e5-d24f-89b6e0d1c9bb@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package
 names.
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
 <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
In-Reply-To: <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>

--------------qCjG6e6Sf4oavodlIjtFAxbt
Content-Type: multipart/mixed; boundary="------------ZkIaZiCLi6QZp0AwQWx2Iquu"

--------------ZkIaZiCLi6QZp0AwQWx2Iquu
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

DQoNCk9uIDI4LTA5LTIwMjIgMjI6MjMsIE1heGltZSBEZXZvcyB3cm90ZToNCj4gWW91wqBt
aXNzZWTCoCJtaW5ldGVzdC0iDQoNCkFsc28sICJsdWEtIi4NCg==
--------------ZkIaZiCLi6QZp0AwQWx2Iquu
Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc"
Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m
xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2
ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL
CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc
/gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4
LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C
kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK
CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W
ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ
Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0
k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo
AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE
fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D
=3DOVqp
-----END PGP PUBLIC KEY BLOCK-----

--------------ZkIaZiCLi6QZp0AwQWx2Iquu--

--------------qCjG6e6Sf4oavodlIjtFAxbt--

--------------Rr0OzhZA9osOVmGVcy7lbzUH
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYzSycgUDAAAAAAAKCRBJ4+4iGRcl7kdV
AP9HAIjLsVfv4TUhdXQzMHTn959UC85BBOX9d+64f/ZA7gD/YMcA1663VeyXP0m1Smpo/sIPQSkL
2nb/NI6Ayf8U7gQ=
=zr2A
-----END PGP SIGNATURE-----

--------------Rr0OzhZA9osOVmGVcy7lbzUH--




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 20:23:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 28 16:23:08 2022
Received: from localhost ([127.0.0.1]:34834 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oddaG-0000b5-1f
	for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 16:23:08 -0400
Received: from michel.telenet-ops.be ([195.130.137.88]:45350)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1oddaE-0000av-Ac
 for 58136 <at> debbugs.gnu.org; Wed, 28 Sep 2022 16:23:06 -0400
Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]
 ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16])
 by michel.telenet-ops.be with bizsmtp
 id RYP42800E20ykKC06YP4a0; Wed, 28 Sep 2022 22:23:05 +0200
Message-ID: <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
Date: Wed, 28 Sep 2022 22:23:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.12.0
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package
 names.
Content-Language: en-US
To: zimoun <zimon.toutoune@HIDDEN>, Lars-Dominik Braun <lars@HIDDEN>,
 58136 <at> debbugs.gnu.org
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
From: Maxime Devos <maximedevos@HIDDEN>
In-Reply-To: <86wn9na82p.fsf@HIDDEN>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------VRpqZKEdXYcL7VgtsiMK7Ych"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1664396585; bh=GiXcFmZYBmzN8g0yIfMOL6VY6u3zy7IiY2lHS6+S+ms=;
 h=Date:Subject:To:Cc:References:From:In-Reply-To;
 b=S69WEmlwQIVonpGyrg1alA5Uv0b7buhmHMzRjC5WXROj+6tRjRrb8ltVOABDcqkno
 dxtwUkWzNUwf8PnhYJD/Dbbor+aj/djuodywGI2G+v7lKPSqUM1sy4MDPehV3FPvKO
 rXDRFEZ8a1asO08KNiIu6iUqN+Q72yEu64SeV8u0TD6VXW52L/9dd24rG+sDxMh36A
 +t5Q3Inr+DT1cPP/25qRt7moSLfsuVAZH+J/IE2ziNPttqeMWtp9jmFGXGqXysbUhW
 pIiqf3Nc9Wj0WVYgHgm9VjhMCPAlDfwixKMEc9q6wlR7NPrB6Tj+q7XvDvk/Xvv2/B
 bbMI9+tzdwJCA==
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 58136
Cc: ludo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.8 (--)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------VRpqZKEdXYcL7VgtsiMK7Ych
Content-Type: multipart/mixed; boundary="------------ULk0SbC0m8ZxbIrjF4oZungj";
 protected-headers="v1"
From: Maxime Devos <maximedevos@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>, Lars-Dominik Braun <lars@HIDDEN>,
 58136 <at> debbugs.gnu.org
Cc: ludo@HIDDEN
Message-ID: <47edd297-92ec-d8a1-5999-813f4b9644db@HIDDEN>
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package
 names.
References: <YzQTieJZSCJGTGY2@HIDDEN> <86wn9na82p.fsf@HIDDEN>
In-Reply-To: <86wn9na82p.fsf@HIDDEN>

--------------ULk0SbC0m8ZxbIrjF4oZungj
Content-Type: multipart/mixed; boundary="------------cipyNXXEvotUpKU2rc0KABdu"

--------------cipyNXXEvotUpKU2rc0KABdu
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

PiArICAgIDs7IEZvciBwYWNrYWdlcyB3aXRoIGEgbGFuZ3VhZ2UgcHJlZml4IChuYW1lc3Bh
Y2VzKSwgYWxzbyBjb21wYXJlIHRoZQ0KDQpZb3UgbWlzc2VkICJtaW5ldGVzdC0iDQoNCk9u
IDI4LTA5LTIwMjIgMTY6MjYsIHppbW91biB3cm90ZToNCj4gICAzLiB1c2UgdXBzdHJlYW0t
bmFtZSBpZiBwcm92aWRlZA0KPiANCj4gV0RZVD8NCg0KRm9yIHRoZSBNaW5ldGVzdCBtb2Rz
ICh3aGljaCBoYXZlIHVwc3RyZWFtLW5hbWVzIGxpa2UgIkplaWphL21lc2Vjb25zIiksIA0K
SSBkb24ndCB0aGluayB0aGluayB0aGUgdXBzdHJlYW0tbmFtZSBpcyB1c2VmdWwgYXMtaXMN
Cg0KR3JlZXRpbmdzLA0KTWF4aW1lLg0K
--------------cipyNXXEvotUpKU2rc0KABdu
Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc"
Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m
xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2
ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL
CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc
/gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4
LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C
kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK
CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W
ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ
Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0
k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo
AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE
fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D
=3DOVqp
-----END PGP PUBLIC KEY BLOCK-----

--------------cipyNXXEvotUpKU2rc0KABdu--

--------------ULk0SbC0m8ZxbIrjF4oZungj--

--------------VRpqZKEdXYcL7VgtsiMK7Ych
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYzStKAUDAAAAAAAKCRBJ4+4iGRcl7lPm
AP9bWR8sDbTkIqHlH3TzYt+m+8SMe5VbUqJHRIS537M+DgD+IMs5rCtZ3UKqDp62ZoI8RUzvLU6c
TZAOStl1eOWDYQ0=
=61Q5
-----END PGP SIGNATURE-----

--------------VRpqZKEdXYcL7VgtsiMK7Ych--




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at 58136 <at> debbugs.gnu.org:


Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 14:42:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 28 10:42:44 2022
Received: from localhost ([127.0.0.1]:34125 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1odYGp-00086g-QB
	for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 10:42:44 -0400
Received: from mail-wm1-f54.google.com ([209.85.128.54]:40479)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1odYGn-00086T-87
 for 58136 <at> debbugs.gnu.org; Wed, 28 Sep 2022 10:42:42 -0400
Received: by mail-wm1-f54.google.com with SMTP id
 u16-20020a05600c211000b003b5152ebf09so1390739wml.5
 for <58136 <at> debbugs.gnu.org>; Wed, 28 Sep 2022 07:42:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=a5R2Y6idmqUJB43TeXLZv1Jv2eAXN72xx+BfH3GmMJ8=;
 b=Dmgfl8NFYwgkQbCcDxAc8qTS/gywdhkz76ue5hOvtB/Rl/WaImoEELzMGX2ORzKBEJ
 tjrmlslG4BLsQH1O5bX/vtBDo5PnCm8id4W+r5XEyoG8QVfBo1zNudUEDD27e2MrieFy
 lQAM9OLvKl0ntLMbcRnmniWRk5hBOM9a0lGB1cU/0Qba3B4uGP6GKao0SgCm3sHgrftI
 cJNfFLEBddcP3Ib6uzc2XPkAhS+WlnBQ4xWqUNy4RpTXtFZTLDiikU+YvEcO6gM8AqCm
 3Ay+qyS56o/N5sk1Kg3J99nYVZlADLAR3hMPdcy+Y2k1LiMNCnCyKQogVqAl5LlRlCdF
 rJ7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date;
 bh=a5R2Y6idmqUJB43TeXLZv1Jv2eAXN72xx+BfH3GmMJ8=;
 b=G5eG5k541OTCMdUflKsxow3vRDocwSAWNnB8qpLWXapH6d79Qs4Tj0LUMSFjw8Pqw1
 vBiRT712Bef8XcGDpn1vFYFyG9NIYyxwYtiYlV3LDVs2OriJ17khr3hc8gUJEMF6vHA9
 bKb4pveBovX2S19LR/HzgOD1WiVd7Ek+zJGIsDZh7ssutU5wjVsbcLbQcsBDmDYkaWtX
 kDFPW5NxMAoyJa6BG7jb/dV4KC7443fDos2UO0HcosFIhUuffNYicLff1yV7eNqmO1Tj
 NBS6Q023q7nFn8fFpm1Igsduabob7pETzwAxWLTULflRKXtjGYrHM2WQdiRJClYKVFk/
 FXRw==
X-Gm-Message-State: ACrzQf15ZWaEuw64KF/XqczgLJIbi/7+O+SbRxbFLaod/Plpbl8ahodP
 xZbW27bAt68tj5iy7C4fNOc=
X-Google-Smtp-Source: AMsMyM5y5g+RUcvPX9DKGx/5TnzOETZh2o+t0kYDGGVC0YlGzC3UMlaosWwMK8x3n77djiK2gnCEDw==
X-Received: by 2002:a05:600c:1c03:b0:3b4:618b:5d14 with SMTP id
 j3-20020a05600c1c0300b003b4618b5d14mr6857540wms.59.1664376155171; 
 Wed, 28 Sep 2022 07:42:35 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id
 iv16-20020a05600c549000b003b4c40378casm2096979wmb.39.2022.09.28.07.42.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Sep 2022 07:42:34 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Lars-Dominik Braun <lars@HIDDEN>, 58136 <at> debbugs.gnu.org
Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching
 package names.
In-Reply-To: <YzQTieJZSCJGTGY2@HIDDEN>
References: <YzQTieJZSCJGTGY2@HIDDEN>
Date: Wed, 28 Sep 2022 16:26:38 +0200
Message-ID: <86wn9na82p.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 58136
Cc: ludo@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Lars,

On Wed, 28 Sep 2022 at 11:27, Lars-Dominik Braun <lars@HIDDEN> wrote:

> I propose we also score the unprefixed package name, so SCORE can award
> bonus points for a full string match. I don=E2=80=99t like that we have to
> maintain a list of common prefixes for this and that package names are
> scored twice now, but I can=E2=80=99t think of a better solution right no=
w.

In addition to your proposal which LGTM, maybe we could also use the
=E2=80=99upstream-name=E2=80=99 properties.  Most of the time, the Guix nam=
e matches the
upstream name, but sometimes not.  Although, it would not fix the issue
for ggplot2 since there is no upstream-name for this package. :-)

Well, I propose something like see below (based on your patch):

 1. keep the weight as 4
 2. set the =E2=80=9Cnamespace=E2=80=9D 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

WDYT?


--8<---------------cut here---------------start------------->8---
diff --git a/guix/ui.scm b/guix/ui.scm
index 55b596ed35..14f296a546 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1655,7 +1655,7 @@ (define (regexp->score regexp)
 (define %package-metrics
   ;; Metrics used to compute the "relevance score" of a package against a =
set
   ;; of regexps.
-  `((,package-name . 8)
+  `((,package-name . 4)
=20
     ;; For packages with a language prefix (namespaces), also compare the
     ;; unprefixed name, so searching for =E2=80=9Cggplot2=E2=80=9D yields
@@ -1684,9 +1684,9 @@ (define %package-metrics
                   (if (string-prefix? prefix name)
                       (cons (substring name (string-length prefix)) accum)
                       accum))
-                '()
+                (list (package-upstream-name package))
                 namespaces)))
-       . 4)
+     . 1)
=20
     ;; Match against uncommon outputs.
     (,(lambda (package)
--8<---------------cut here---------------end--------------->8---


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Sep 2022 09:27:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 28 05:27:56 2022
Received: from localhost ([127.0.0.1]:60140 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1odTMA-0005Cj-PX
	for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 05:27:55 -0400
Received: from lists.gnu.org ([209.51.188.17]:45830)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lars@HIDDEN>) id 1odTM6-0005CV-VI
 for submit <at> debbugs.gnu.org; Wed, 28 Sep 2022 05:27:53 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59710)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <lars@HIDDEN>) id 1odTM6-0000xv-1s
 for guix-patches@HIDDEN; Wed, 28 Sep 2022 05:27:50 -0400
Received: from mout-p-101.mailbox.org ([80.241.56.151]:58070)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <lars@HIDDEN>) id 1odTM1-0001qc-TH
 for guix-patches@HIDDEN; Wed, 28 Sep 2022 05:27:49 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4McrkM1kYDz9sm7
 for <guix-patches@HIDDEN>; Wed, 28 Sep 2022 11:27:39 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001;
 t=1664357259;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=tMDOUhTonqWUQcCDPMYxDx63BpgJ3CHa5CelZbcPYDg=;
 b=sCR+nBduy+cBdvsiRtWB4HyQnW/VA13h2ekgU2fDPxjwgLvslCLUWp+xb0URrTmBbG7tUI
 /Czyu5dcK0YgYN3X2vPJL3fVGltW1gXFPC22modthOgVK2LDYxCBwCPEOQEafOVT+Q3fwi
 wzTrGE3cLKtxsi8PxDwpVxd+/xYWsaMMyooS8LM4K+uEsJHzSfJyjKQHnQrltJNSE6zCcS
 qmMlPXWZ3QdhKNm8+MnRlyCog1ZxUkaxUPELbyWXM6Dz5nWVZd8xaoM0eh4SUc9k/nVqo1
 J1eMkEw5zokOL2yspE9WcZYUPXmk+AEjZp3xNS30ZqEoqkHGkSPUAysWWQqVjg==
Date: Wed, 28 Sep 2022 11:27:37 +0200
From: Lars-Dominik Braun <lars@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] ui: Improve sort order when searching package names.
Message-ID: <YzQTieJZSCJGTGY2@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Debbugs-Cc: mail@HIDDEN
X-Debbugs-Cc: rekado@HIDDEN
X-Debbugs-Cc: othacehe@HIDDEN
X-Debbugs-Cc: ludo@HIDDEN
X-Rspamd-Queue-Id: 4McrkM1kYDz9sm7
Received-SPF: pass client-ip=80.241.56.151; envelope-from=lars@HIDDEN;
 helo=mout-p-101.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hi,

we provide a `guix serach`-based package search to our users and noticed
that searching for “ggplot2” yields the package r-ggplot2 on position
11 only – when it should be the first. Looking at other potential
search terms (haven, shiny, ape, renv, here, ini, setuptools) reveals
similar issues.

I propose we also score the unprefixed package name, so SCORE can award
bonus points for a full string match. I don’t like that we have to
maintain a list of common prefixes for this and that package names are
scored twice now, but I can’t think of a better solution right now.

Cheers,
Lars


* guix/ui.scm (%package-metrics): Increase score for PACKAGE-NAME and
add score for unprefixed package name.
---
 guix/ui.scm | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index dad2b853ac..55b596ed35 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1655,7 +1655,38 @@ (define (regexp->score regexp)
 (define %package-metrics
   ;; Metrics used to compute the "relevance score" of a package against a set
   ;; of regexps.
-  `((,package-name . 4)
+  `((,package-name . 8)
+
+    ;; For packages with a language prefix (namespaces), also compare the
+    ;; unprefixed name, so searching for “ggplot2” yields
+    ;; r-ggplot2 as first result instead of other, higher-ranked packages,
+    ;; which contain “ggplot2” in their description alot.
+    (,(lambda (package)
+        (let ((namespaces (list "cl-"
+                                "ecl-"
+                                "emacs-"
+                                "ghc-"
+                                "go-"
+                                "guile-"
+                                "java-"
+                                "julia-"
+                                "node-"
+                                "ocaml-"
+                                "perl-"
+                                "python-"
+                                "r-"
+                                "ruby-"
+                                "rust-"
+                                "sbcl-"
+                                "texlive-"))
+              (name (package-name package)))
+          (fold (lambda (prefix accum)
+                  (if (string-prefix? prefix name)
+                      (cons (substring name (string-length prefix)) accum)
+                      accum))
+                '()
+                namespaces)))
+       . 4)
 
     ;; Match against uncommon outputs.
     (,(lambda (package)
-- 
2.35.1





Acknowledgement sent to Lars-Dominik Braun <lars@HIDDEN>:
New bug report received and forwarded. Copy sent to ludo@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to ludo@HIDDEN, guix-patches@HIDDEN:
bug#58136; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 3 Nov 2022 16:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.