help-debbugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debbugs full text search via SOAP


From: Michael Albinus
Subject: Debbugs full text search via SOAP
Date: Tue, 06 Sep 2011 11:42:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi,

I propose to extend the debbugs SOAP interface by a full text search via
the hyperestraier search engine, bundled in debbugs. I have implemented
a proof of concept on debbugs.gnu.org, see below for a test script.

The extension could be a new function Debbugs::SOAP::search_est like this:

--8<---------------cut here---------------start------------->8---
=head2 search_est

     my @results = search_est([phrase => 'armstrong AND debbugs',
                               skip => 10,
                               max => 20,
                              ],
                              [severity => 'normal',
                               operator => 'STRINC',
                              ],
                              [date => '',
                               order => 'NUMA',
                              ],
                              )

Returns an arrayref of hashrefs which output the status for specific
sets of bugs, and the found snippets.

'phrase' is a search phrase as used by the hyperestraier search engine,
see <http://fallabs.com/hyperestraier/uguide-en.html#searchcond> for syntax.
'skip' defines how many search results shall be skipped, 'max' defines
the maximum number of results to be returned.  Both values are used
for paged display.

All other hashes define a search condidition for a given attribute.
Attributes are '@cdate', '@title', '@author', 'status', 'subject',
'date', 'submitter', 'package', 'tags' or 'severity'.  Their values
could be a string or a number.  If an attribute has a value,
'operator' defines the comparison operator, see the hyperestraier
user guide for valid operators.

'order' is optional, it defines the sort order of the results.  It
could be combined with an empty-value attribute, in this case the
attribute is not used for search but for sorting of the result. If
several hashes contain the 'order' spec, the last one will be used.

Returns a sorted set of hits; this is an array of hashes with the
following attributes:

 address@hidden => '',
   @author => '',
   @cdate    => '',
   @uri => '',
   id => '',
   msg_num => '',
   date => '',
   subject => '',
   severity => '',
   package  => '',
   snippet  => '',
  },
  ...
 ]

'snippet' is the surrounding text found by the search.

=cut
--8<---------------cut here---------------end--------------->8---

A demonstration of this function is the test implementation on
debbugs.gnu.org. One could try it with the following Perl script:

--8<---------------cut here---------------start------------->8---
#!/usr/bin/perl

use SOAP::Lite;
use Data::Dumper;

my $soap = 
SOAP::Lite->uri('Debbugs/SOAP')->proxy('http://debbugs.gnu.org/cgi/soap.cgi');

my @result = $soap->search_est([phrase => 'armstrong AND debbugs',
                                skip => 10,
                                max => 2],
                               [severity => 'normal',
                                operator => 'STRINC'],
                               [date => '',
                                order => 'NUMA'])->result();

print Dumper(@result);
--8<---------------cut here---------------end--------------->8---

What do people think?

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]