# build a request for SearchAuthorities
my $query='at='.$authtypecode.' ';
map {$query.= " and he=\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/)} $record->field($auth_tag_to_report)->subfields() if $record->field($auth_tag_to_report);
- my ($error,$results)=SimpleSearch( $query, 0, 1, [ "authorityserver" ] );
+ my ($error, $results, $total_hits)=SimpleSearch( $query, 0, 1, [ "authorityserver" ] );
# there is at least 1 result => return the 1st one
if (@$results>0) {
my $marcrecord = MARC::File::USMARC::decode($results->[0]);
my $self = shift;
my $query = qq(Match-heading,ext="$self->{'search_form'}");
$query .= $self->_query_limiters();
- my $results = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
+ my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
return $results;
}
my $self = shift;
my $query = "Match-heading-see-from,ext='$self->{'search_form'}'";
$query .= $self->_query_limiters();
- my $results = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
+ my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
return $results;
}
# build query
my $query = join(" or ", map { "$matchpoint->{'index'}=$_" } @source_keys);
# FIXME only searching biblio index at the moment
- my ($error, $searchresults) = SimpleSearch($query);
+ my ($error, $searchresults, $total_hits) = SimpleSearch($query);
warn "search failed ($query) $error" if $error;
foreach my $matched (@$searchresults) {
# Search if there is any authorities to link to.
my $query='at='.$data->{authtypecode}.' ';
map {$query.= ' and he,ext="'.$_->[1].'"' if ($_->[0]=~/[A-z]/)} $field->subfields();
- my ($error,$results)=SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
+ my ($error, $results, $total_hits)=SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
# there is only 1 result
if ( $error ) {
warn "BIBLIOADDSAUTHORITIES: $error";
if ($query) {
# find results
- my ( $error, $marcresults ) = SimpleSearch($query);
+ my ( $error, $marcresults, $total_hits ) = SimpleSearch($query);
if ( defined $error ) {
$template->param( error => $error );
my $startfrom = $query->param('startfrom');
my $resultsperpage = $query->param('resultsperpage');
my $orderby;
- my ( $errors, $results ) = SimpleSearch($search);
+ my ( $errors, $results, $total_hits ) = SimpleSearch($search);
my $total = scalar(@$results);
$resultsperpage = 20 unless $resultsperpage;
my $startfrom = $query->param('startfrom') || 0;
my ( $template, $loggedinuser, $cookie );
+my $total_hits;
my (@marclist,@and_or,@excluding,@operator,@value,$orderby,@tags,$results,$total,$error,$marcresults);
# XXX should this be maxItemsInSearchResults or numSearchResults preference instead of 19?
my $resultsperpage = $query->param('resultsperpage') || 19;
#catalogsearch( $dbh, \@tags, \@and_or, \@excluding, \@operator, \@value,
# $startfrom * $resultsperpage,
# $resultsperpage, $orderby );
- ( $error, $marcresults, $total ) = SimpleSearch( $marclist[0], $startfrom, $resultsperpage );
- warn "\$total=$total";
+ ( $error, $marcresults, $total_hits ) = SimpleSearch( $marclist[0], $startfrom, $resultsperpage );
if ($marcresults) {
$show_results = scalar @$marcresults;
} else {
}
my @numbers = ();
+ $total = $total_hits;
if ( $total > $resultsperpage ) {
for ( my $i = 1 ; $i < $total / $resultsperpage + 1 ; $i++ ) {
if ( $i < 16 ) {
startfromnext => $startfrom + min( $resultsperpage, scalar @results ),
startfromprev => max( $startfrom - $resultsperpage, 0 ),
searchdata => \@field_data,
- total => $total,
+ total => $total_hits,
from => $startfrom + 1,
to => $startfrom + min( $resultsperpage, scalar @results ),
numbers => \@numbers,
);
warn "fetching $size results for $query";
- my ( $error, $marcresults ) = SimpleSearch( $query, 0, $size );
+ my ( $error, $marcresults, $total_hits ) = SimpleSearch( $query, 0, $size );
my $hits = scalar @$marcresults;
my @results;
$resultsperpage= $input->param('resultsperpage');
$resultsperpage = 19 if(!defined $resultsperpage);
- my ($error,$marcrecords) = SimpleSearch($query);
+ my ($error, $marcrecords, $total_hits) = SimpleSearch($query);
my $total = scalar @$marcrecords;
if (defined $error) {