diff options
author | Arun Isaac <arunisaac@systemreboot.net> | 2020-03-07 19:01:16 +0530 |
---|---|---|
committer | Guix Patches Tester <> | 2020-03-07 13:33:14 +0000 |
commit | a84513a496349455fc8944c505bade9d35428a12 (patch) | |
tree | f1609da5f613aeba2754de2476866019d0fc8006 /guix/scripts/package.scm | |
parent | c32a5b44aadb89b818d4a7c317443b376afdd22f (diff) | |
download | patches-a84513a496349455fc8944c505bade9d35428a12.tar patches-a84513a496349455fc8944c505bade9d35428a12.tar.gz |
gnu: Use Xapian index for package search.series-3104
* gnu/packages.scm (search-package-index): New function.
* guix/ui.scm (display-package-search-results): New function.
* guix/scripts/package.scm (process-query): Search using the Xapian package
index if current profile is available. Else, search using regexps.
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r-- | guix/scripts/package.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index d2f4f1ccd3..91c975b168 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2016 Benz Schenk <benz.schenk@uzh.ch> ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com> ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -781,9 +782,11 @@ processed, #f otherwise." (_ #f)) opts)) (regexps (map (cut make-regexp* <> regexp/icase) patterns)) - (matches (find-packages-by-description regexps))) + (matches (if (current-profile) + (search-package-index (current-profile) (string-join patterns " ")) + (find-packages-by-description regexps)))) (leave-on-EPIPE - (display-search-results matches (current-output-port))) + (display-package-search-results matches (current-output-port))) #t)) (('show requested-name) |