From: "Ludovic Courtès" <ludo@gnu.org>
To: Chris Marusich <cmmarusich@gmail.com>
Cc: 35588@debbugs.gnu.org
Subject: bug#35588: [PATCH] ui: Search matches additional package outputs.
Date: Tue, 07 May 2019 10:25:39 +0200 [thread overview]
Message-ID: <87mujy8yd8.fsf@gnu.org> (raw)
In-Reply-To: <87zhnzxer9.fsf@gmail.com> (Chris Marusich's message of "Mon, 06 May 2019 17:57:46 -0700")
Hello,
Chris Marusich <cmmarusich@gmail.com> skribis:
> From c1150a217a416ef4ceccf87c56e36e8e921f873a Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> 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 <me@tobias.gr>
[...]
> (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’.
next prev parent reply other threads:[~2019-05-07 8:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-05 19:39 bug#35588: guix package --search does not search output names Chris Marusich
2019-05-05 21:41 ` bug#35588: [PATCH] ui: Search matches additional package outputs Tobias Geerinckx-Rice
2019-05-06 9:08 ` Chris Marusich
2019-05-06 9:32 ` Ludovic Courtès
2019-05-07 0:57 ` Chris Marusich
2019-05-07 8:25 ` Ludovic Courtès [this message]
2019-05-08 6:50 ` bug#35588: [PATCH] ui: Search matches additional package outputs., " Chris Marusich
2019-05-08 10:39 ` Ludovic Courtès
2019-05-09 7:22 ` Chris Marusich
2019-05-07 22:24 ` swedebugia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mujy8yd8.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=35588@debbugs.gnu.org \
--cc=cmmarusich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.