bug 1890: fixing calls to C4::Search::SimpleSearch
authorAndrew Moore <andrew.moore@liblime.com>
Thu, 27 Mar 2008 16:39:20 +0000 (11:39 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 1 Apr 2008 11:44:23 +0000 (06:44 -0500)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/AuthoritiesMarc.pm
C4/Heading.pm
cataloguing/addbiblio.pl
opac/opac-rss.pl

index 04210cc..c46187d 100644 (file)
@@ -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]);
index e57438f..0371d2a 100644 (file)
@@ -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;
 }
 
index 4df8d64..a93f63f 100755 (executable)
@@ -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";
index 0d95f7f..d73a6cb 100755 (executable)
@@ -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;