diff -rc koha-2.2.5-orig/opac-cgi/opac-search.pl koha-2.2.5-patch/opac-cgi/opac-search.pl
*** koha-2.2.5-orig/opac-cgi/opac-search.pl	2006-01-13 14:24:19.000000000 -0700
--- koha-2.2.5-patch/opac-cgi/opac-search.pl	2006-05-23 16:19:52.000000000 -0600
***************
*** 74,82 ****
  		}
  	}
  	findseealso($dbh,\@tags);
  	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
  										\@excluding, \@operator, \@value,
  										$startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc);
  	if ($total ==1) {
  	if (C4::Context->preference("BiblioDefaultView") eq "normal") {
  	     print $query->redirect("/cgi-bin/koha/opac-detail.pl?bib=".@$results[0]->{biblionumber});
--- 88,144 ----
  		}
  	}
  	findseealso($dbh,\@tags);
+ SearchPoint:
  	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
  					     \@excluding, \@operator, \@value,
  					     $startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc);
  
  	# hide records not to be returned in opac.
  	for (my $i=0; $i <= $#$results; $i++) {
  	    if ($$results[$i]->{notforopac}) {
  		splice @$results,$i,1; # remove that element
  		$i--;  # counter $i++ in for()
  		$total-- if ($total <= $resultsperpage);  # one less total
  	    }
  	}
  
  	# hide record not in this branch if IndependantBranches
  	if (C4::Context->preference("IndependantBranches") && $branch) {
  	    for (my $i=0; $i <= $#$results; $i++) {
  		my @items = @{$$results[$i]->{CN}};
  		for (my $it=0; $it <= $#items; $it++) {
  		    if ($items[$it]{holdingbranch} != $branch) {
  			splice @items,$it,1; # remove that element
  			$it--;  # counter $it++ in for()
  			$$results[$i]{totitem}--;
  		    } else { # IndependantBranches is on, so hide holdingbranch
  			$items[$it]{holdingbranch} = "";
  			$items[$it]{holdingbranchname} = "";
  			$items[$it]{location} = "";
  		    }
  		}
  		if (@items) {
  		    @{$$results[$i]->{CN}} = @items; # re-store items
  		    $$results[$i]->{totitem} = $#items + 1;
  		} else {
  		    splice @$results,$i,1; # items empty, remove record
  		    $i--;  # counter $i++ in for()
  		    $total--;  # one less total
  		}
  	    }
  	}
! 
! 	if ($total == 0 && $passes == 0) {
! 	    #first pass, no results.  chop search terms down and try again.
! 	    for ($list_index = 0; $list_index <= $#marclist; $list_index++) {
! 		if ($marclist[$list_index] =~ /(biblio.title)|(biblio.author)|(bibliosubject.subject)|(biblio.seriestitle)|(biblioitems.publishercode)|()/) {
! 		    $value[$list_index] = substr($value[$list_index],0,4);
! 		}
! 	    }
! 	    $passes++;
! 	    goto SearchPoint;
! 	}
! 
  	if ($total ==1) {
  	if (C4::Context->preference("BiblioDefaultView") eq "normal") {
  	     print $query->redirect("/cgi-bin/koha/opac-detail.pl?bib=".@$results[0]->{biblionumber});