From e16ded6012dcebea6f57e0ec7f7d2d07843a3003 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 14 Feb 2006 10:54:02 +0000 Subject: [PATCH] fixing bugs for : * search on 2 words "applied chaos" * retrieve results when there's only 1 answer (still dirty & to be rewritten by chris, but it's useful for me) --- C4/SearchMarc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index 095d66fac7..941aecf165 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -223,9 +223,9 @@ sub catalogsearch { $query .= " and " if ($query); my $field = $tagslib->{$tag}->{$subfield}->{kohafield}; if ($field eq 'biblio.author') { - $query .= "Author= ".@$value[$i]; + $query .= "Author= \"".@$value[$i]."\""; } elsif ($field eq 'biblio.title') { - $query .= "Title= ".@$value[$i]; + $query .= "Title= \"".@$value[$i]."\""; } elsif ($field eq 'biblioitems.isbn') { $query .= "Isbn= ".@$value[$i]; } else { @@ -260,8 +260,8 @@ sub catalogsearch { my $totalitems=0; $offset=0 unless $offset; # calculate max offset - my $maxrecordnum = $offset+$length<$numresults?$offset+$length:$numresults; - for (my $i=$offset; $i < $maxrecordnum; $i++) { + my $maxrecordnum = $offset+$length<$numresults?$offset+$length:($numresults); + for (my $i=$offset-1; $i <= $maxrecordnum-1; $i++) { # get the MARC record (in XML)... # warn "REC $i = ".$rs->record($i)->raw(); # FIXME : it's a silly way to do things : XML => MARC::Record => hash. We had better developping a XML=> hash (in biblio.pm) -- 2.39.2