mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
ui: Bypass Texinfo parsing and rendering for searches.
This makes search queries such as: LANGUAGE=fr guix package -s utilitaire -s recherche about 6 times faster. * guix/ui.scm (%package-metrics): Do not use 'package-synopsis-string' and 'package-description-string' to bypass Texinfo parsing and rendering.
This commit is contained in:
parent
7b7e4e89c8
commit
94aeec0aef
1 changed files with 8 additions and 2 deletions
10
guix/ui.scm
10
guix/ui.scm
|
@ -1329,8 +1329,14 @@ (define %package-metrics
|
|||
;; Metrics used to compute the "relevance score" of a package against a set
|
||||
;; of regexps.
|
||||
`((,package-name . 4)
|
||||
(,package-synopsis-string . 3)
|
||||
(,package-description-string . 2)
|
||||
|
||||
;; Match regexps on the raw Texinfo since formatting it is quite expensive
|
||||
;; and doesn't have much of an effect on search results.
|
||||
(,(lambda (package)
|
||||
(and=> (package-synopsis package) P_)) . 3)
|
||||
(,(lambda (package)
|
||||
(and=> (package-description package) P_)) . 2)
|
||||
|
||||
(,(lambda (type)
|
||||
(match (and=> (package-location type) location-file)
|
||||
((? string? file) (basename file ".scm"))
|
||||
|
|
Loading…
Reference in a new issue