[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/06: ui: Add source file name to the package search metrics.
From: |
Ludovic Courtès |
Subject: |
06/06: ui: Add source file name to the package search metrics. |
Date: |
Thu, 16 Nov 2017 02:49:45 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 304a53f67aa4970dec98586e74c45487b0cd68ae
Author: Ludovic Courtès <address@hidden>
Date: Wed Nov 15 17:38:21 2017 +0100
ui: Add source file name to the package search metrics.
* guix/ui.scm (%package-metrics): Include 'package-location'. Increase
score of the other fields.
---
guix/ui.scm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index 05782a5..0fc5ab6 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1121,9 +1121,14 @@ score, the more relevant OBJ is to REGEXPS."
(define %package-metrics
;; Metrics used to compute the "relevance score" of a package against a set
;; of regexps.
- `((,package-name . 3)
- (,package-synopsis-string . 2)
- (,package-description-string . 1)))
+ `((,package-name . 4)
+ (,package-synopsis-string . 3)
+ (,package-description-string . 2)
+ (,(lambda (type)
+ (match (and=> (package-location type) location-file)
+ ((? string? file) (basename file ".scm"))
+ (#f "")))
+ . 1)))
(define (package-relevance package regexps)
"Return a score denoting the relevance of PACKAGE for REGEXPS. A score of
- branch master updated (c114c9c -> 304a53f), Ludovic Courtès, 2017/11/16
- 01/06: download: Improve efficiency of 'write-request' over TLS., Ludovic Courtès, 2017/11/16
- 02/06: cve: Use 'http-fetch/cached' instead of having custom caching., Ludovic Courtès, 2017/11/16
- 06/06: ui: Add source file name to the package search metrics.,
Ludovic Courtès <=
- 04/06: gnu: Move Python packages from crypto to python-crypto., Ludovic Courtès, 2017/11/16
- 05/06: gnu: Move more packages from python to python-web., Ludovic Courtès, 2017/11/16
- 03/06: gnu: Move crypto packages from python to python-crypto., Ludovic Courtès, 2017/11/16