359 |
$tmpl->param('full',0); |
$tmpl->param('full',0); |
360 |
} |
} |
361 |
|
|
362 |
|
my $swish_msg = ' '; |
363 |
|
|
364 |
# create new swish instance |
# create new swish instance |
365 |
my $swish = SWISH::API->new($INDEX); |
my $swish = SWISH::API->new($INDEX); |
366 |
die $swish->ErrorString.": ".$swish->LastErrorMsg if $swish->Error; |
$swish_msg .= $swish->ErrorString." ".$swish->LastErrorMsg if $swish->Error; |
367 |
|
|
368 |
# execute query and get number of results from SWISH-E |
# execute query and get number of results from SWISH-E |
369 |
my $search = $swish->New_Search_Object; |
my $search = $swish->New_Search_Object; |
371 |
$search->SetSort($sort); |
$search->SetSort($sort); |
372 |
|
|
373 |
my $results = $search->Execute($sw_q); |
my $results = $search->Execute($sw_q); |
374 |
die $swish->ErrorString.": ".$swish->LastErrorMsg if $swish->Error; |
$swish_msg .= $swish->ErrorString." ".$swish->LastErrorMsg if $swish->Error; |
375 |
|
|
376 |
my $hits = $results->Hits; |
my $hits = $results->Hits; |
377 |
|
|
378 |
$tmpl->param('hits',$hits); |
$tmpl->param('hits',$hits); |
379 |
$tmpl->param('search',$sw_q); |
my $search_msg = $sw_q; |
380 |
|
$search_msg .= '<em>'.$swish_msg.'</em>' if ($swish_msg); |
381 |
|
$tmpl->param('search', $search_msg); |
382 |
|
|
383 |
$tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0); |
$tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0); |
384 |
$tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0); |
$tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0); |