From 5c51edc653b4d5afd3494f48e2dc0a9508169d12 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Thu, 27 Mar 2008 11:39:20 -0500 Subject: [PATCH] bug 1890: fixing calls to C4::Search::SimpleSearch Signed-off-by: Galen Charlton Signed-off-by: Joshua Ferraro --- C4/AuthoritiesMarc.pm | 2 +- C4/Heading.pm | 4 ++-- cataloguing/addbiblio.pl | 2 +- opac/opac-rss.pl | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 04210cc472..c46187d533 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -802,7 +802,7 @@ sub FindDuplicateAuthority { # 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,"authorityserver"); + my ($error,$results)=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]); diff --git a/C4/Heading.pm b/C4/Heading.pm index e57438f2c3..0371d2a704 100644 --- a/C4/Heading.pm +++ b/C4/Heading.pm @@ -119,7 +119,7 @@ sub authorities { my $self = shift; my $query = qq(Match-heading,ext="$self->{'search_form'}"); $query .= $self->_query_limiters(); - my $results = SimpleSearch($query, "authorityserver"); + my $results = SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); return $results; } @@ -140,7 +140,7 @@ sub preferred_authorities { my $self = shift; my $query = "Match-heading-see-from,ext='$self->{'search_form'}'"; $query .= $self->_query_limiters(); - my $results = SimpleSearch($query, "authorityserver"); + my $results = SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); return $results; } diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 4df8d64553..a93f63f93e 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -678,7 +678,7 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|); # 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,"authorityserver"); + my ($error,$results)=SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); # there is only 1 result if ( $error ) { warn "BIBLIOADDSAUTHORITIES: $error"; diff --git a/opac/opac-rss.pl b/opac/opac-rss.pl index 0d95f7f383..d73a6cb970 100755 --- a/opac/opac-rss.pl +++ b/opac/opac-rss.pl @@ -121,11 +121,10 @@ if ($RDF_update_needed) { }, ); - my $total; # the total results for the whole set - my ( $error, $marcresults ) = SimpleSearch($query); + warn "fetching $size results for $query"; + my ( $error, $marcresults ) = SimpleSearch( $query, 0, $size ); my $hits = scalar @$marcresults; - $hits = $size if $hits > $size; my @results; for ( my $i = 0 ; $i < $hits ; $i++ ) { my %resultsloop; -- 2.39.5