X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=dfca595f9c4bf12ce0c59f350fad544d6da67b60;hp=e957091f3a16f8658d5605e6da3fd2ea36f0a807;hb=34006aed3916d7c41c4de2811a7451888fcdff22;hpb=f07da2fa4daa7525e39a42d417cd68ac6fc83d30 diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index e957091..dfca595 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,10 +1,10 @@ -%# $Id: found.mc,v 1.5 2006-09-19 16:35:25 mike Exp $ +%# $Id: found.mc,v 1.8 2006-09-20 16:37:15 mike Exp $ <%once> use XML::LibXML; use XML::LibXML::XPathContext; %once> <%perl> -my %params = map { ( $_, $r->param($_)) } $r->param(); +my %params = map { ( $_, $r->param($_)) } grep { $r->param($_) } $r->param(); my $query = ""; foreach my $key (keys %params) { next if $key =~ /^_/; @@ -17,15 +17,20 @@ $query = 'cql.allRecords=x' if $query eq ""; my $sort = $params{"_sort"}; if ($sort) { + my $modifiers = ""; + if ($sort =~ s/(\/.*)//) { + $modifiers = $1; + } $query .= " or $sort=/sort"; $query .= "-desc" if $params{_desc}; + $query .= $modifiers; $query .= " 0"; } ### We can think about keeping the Connection object open to re-use # for multiple requests, but that may not get us much. Same applies # for the XML parser. -my $conn = new ZOOM::Connection("localhost:1313/IR-Explain---1"); +my $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1"); $conn->option(elementSetName => "zeerex"); my $parser = new XML::LibXML(); @@ -71,12 +76,14 @@ if ($last < $n) {