From: Simon Jacob Date: Mon, 11 Feb 2013 01:00:00 +0000 (+1100) Subject: Added support for the sortby2 function to allow sorting of SOLR databases. X-Git-Tag: v1.29~24^2 X-Git-Url: http://git.indexdata.com/?p=ZOOM-Perl-moved-to-github.git;a=commitdiff_plain;h=835606293987084b8caa9978adf1c98b55d3a52a Added support for the sortby2 function to allow sorting of SOLR databases. --- diff --git a/ZOOM.xs b/ZOOM.xs index 4e5de76..b10513e 100644 --- a/ZOOM.xs +++ b/ZOOM.xs @@ -388,6 +388,12 @@ int ZOOM_query_sortby(s, criteria) ZOOM_query s const char * criteria + +int +ZOOM_query_sortby2(s, strategy, criteria) + ZOOM_query s + const char * strategy + const char * criteria ZOOM_scanset ZOOM_connection_scan(c, startterm) diff --git a/lib/ZOOM.pm b/lib/ZOOM.pm index b85163f..6b2f8c9 100644 --- a/lib/ZOOM.pm +++ b/lib/ZOOM.pm @@ -578,6 +578,14 @@ sub sortby { or ZOOM::_oops(ZOOM::Error::SORTBY, $sortby); } +sub sortby2 { + my $this = shift(); + my($strategy, $sortby) = @_; + + Net::Z3950::ZOOM::query_sortby2($this->_query(), $strategy, $sortby) == 0 + or ZOOM::_oops(ZOOM::Error::SORTBY, $sortby); +} + sub destroy { my $this = shift();