diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2017-11-20 22:38:28 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2017-11-20 22:38:28 +0100 |
commit | f60c89f24f76d57434c3574136fa5cdaf595985a (patch) | |
tree | ae6afa2e480d78625a2e6f7d00f0986cd7262159 | |
parent | 3604795dd9c87ca2fc36a7935b6be3d84ab7d74c (diff) |
debbugs: Add search-est operation.
* debbugs/operations.scm (search-est): New procedure.
* doc/guile-debbugs.texi (Operations): Document it.
-rw-r--r-- | debbugs/operations.scm | 24 | ||||
-rw-r--r-- | doc/guile-debbugs.texi | 13 |
2 files changed, 36 insertions, 1 deletions
diff --git a/debbugs/operations.scm b/debbugs/operations.scm index c76660d..5758471 100644 --- a/debbugs/operations.scm +++ b/debbugs/operations.scm @@ -23,7 +23,8 @@ #:use-module (sxml xpath) #:use-module (sxml match) #:use-module (srfi srfi-1) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:use-module (ice-9 optargs)) (define-public (newest-bugs amount) "Return a list of bug numbers corresponding to the newest AMOUNT @@ -118,3 +119,24 @@ all bugs that have been tagged by EMAIL." (cdr pair)) pair))) tags))))))) + +;; This is not implemented in the Debian deployment of Debbugs. +(define*-public (search-est phrase #:optional (skip 0) (max #f)) + "Return the result of a full text search according to PHRASE. When +SKIP is provided the given number of hits will be skipped; this is +useful for paged results. At most MAX results are returned when MAX +is provided. The number of returned results is always limited by the +absolute maximum returned by the Debbugs server." + (soap-request + `(ns1:search_est + (@ (xmlns:ns1 . "urn:Debbugs/SOAP") + (soapenc:encodingStyle . "http://schemas.xmlsoap.org/soap/encoding/")) + (ns1:phrase + (@ (xsi:type "xsd:string")) ,phrase) + (ns1:skip + (@ (xsi:type "xsd:int")) ,skip) + ,@(if max `(ns1:max + (@ (xsi:type "xsd:int")) ,max) + '())) + ;; TODO: implement response hander + )) diff --git a/doc/guile-debbugs.texi b/doc/guile-debbugs.texi index 615e16c..1b47b86 100644 --- a/doc/guile-debbugs.texi +++ b/doc/guile-debbugs.texi @@ -259,6 +259,19 @@ lists of bug numbers for all bugs that have been tagged by @var{email}, a string holding an email address. @end deffn +@cindex search-est, operation +@deffn {Scheme Procedure} search-est @var{phrase} [@var{skip}] [@var{max}] +Return the result of a full text search according to the string +@var{phrase}. When @var{skip} is provided, the given number of hits +will be skipped; this is useful for paged results. At most @var{max} +results are returned when @var{max} is provided. The number of returned +results is always limited by the absolute maximum returned by the +Debbugs server. + +This operation may not be supported by all Debbugs instances. +@end deffn + + @c ********************************************************************* @node Bug helpers @section Bug helpers |