Subject: Re: bug#35588: [PATCH] ui: Search matches additional package outputs.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 07 May 2019 10:25:39 +0200

Hello,

Chris Marusich <[email-masked]> skribis:

> From c1150a217a416ef4ceccf87c56e36e8e921f873a Mon Sep 17 00:00:00 2001
> From: Chris Marusich <[email-masked]>
> Date: Mon, 6 May 2019 01:51:30 -0700
> Subject: [PATCH] ui: Make package outputs searchable.
>
> * guix/ui.scm (relevance): Allow the "field" procedure of a metric to
> return a list, and handle that case appropriately.  Update docstring.
> (%package-metrics): Add a metric for package outputs.
> * guix/scripts/package.scm (find-packages-by-description): Update
> docstring.
>
> Co-authored-by: Tobias Geerinckx-Rice <[email-masked]>

[...]

>               (match (field obj)
>                 (#f  relevance)
> -               (str (+ relevance
> -                       (* (score str) weight)))))))
> +               ((? string? str) (+ relevance
> +                                   (* (score str) weight)))
> +               ((? list? lst) (+ relevance
> +                                 (* weight
> +                                    (apply + (map score lst)))))))))

Nitpick: it’s a bit subjective, but I think this clause might be
slightly nicer like this:

  ((lst ...)
   (+ relevance (* weight (reduce + 0 (map score lst)))))

Anyway, LGTM!

Thanks,
Ludo’.