--- branches/tehnika/WebPac.pm 2005/01/27 21:17:47 652 +++ branches/tehnika/WebPac.pm 2005/02/16 00:04:24 669 @@ -345,6 +345,13 @@ push @persist_vars, "sort"; } + my $sortby = $q->param("sortby"); + if ($sortby) { + $sort = $sortby; + push @persist_vars, "sortby"; + } + $tmpl->param('url_params_paths',"?".join("&",@url_params).'&'.join("&",map { my $t = $_; $t =~ s/\#/%23/g; "path=$t"; } @path_arr)); + # construct swish query my $sw_q = join(" and ",@s_arr); if (@path_arr && $q->param('show_full')) { @@ -359,9 +366,11 @@ $tmpl->param('full',0); } + my $swish_msg = ' '; + # create new swish instance my $swish = SWISH::API->new($INDEX); - die $swish->ErrorString.": ".$swish->LastErrorMsg if $swish->Error; + $swish_msg .= $swish->ErrorString." ".$swish->LastErrorMsg if $swish->Error; # execute query and get number of results from SWISH-E my $search = $swish->New_Search_Object; @@ -369,12 +378,14 @@ $search->SetSort($sort); my $results = $search->Execute($sw_q); - die $swish->ErrorString.": ".$swish->LastErrorMsg if $swish->Error; + $swish_msg .= $swish->ErrorString." ".$swish->LastErrorMsg if $swish->Error; my $hits = $results->Hits; $tmpl->param('hits',$hits); - $tmpl->param('search',$sw_q); + my $search_msg = $sw_q; + $search_msg .= ''.$swish_msg.'' if ($swish_msg); + $tmpl->param('search', $search_msg); $tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0); $tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0);