From 8b6cb0a412712c96d12fe5b0bf18edc87758f308 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Fri, 8 Jul 2011 09:04:47 +1200 Subject: [PATCH] Bug 2809 : Rebased and Reformatted for master, please test thoroughly --- C4/Search.pm | 42 +++++++++++++++++++++++------------------- 1 files changed, 23 insertions(+), 19 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index c3cff65..9a66c9c 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1147,15 +1147,15 @@ sub buildQuery { # Date of Publication if ( $index eq 'yr' ) { $index .= ",st-numeric"; - $indexes_set++; - $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; +# $indexes_set++; + $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; } # Date of Acquisition elsif ( $index eq 'acqdate' ) { $index .= ",st-date-normalized"; - $indexes_set++; - $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; +# $indexes_set++; + $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; } # ISBN,ISSN,Standard Number, don't need special treatment elsif ( $index eq 'nb' || $index eq 'ns' ) { @@ -1336,21 +1336,25 @@ sub buildQuery { # Regular old limits else { - $limit .= " and " if $limit || $query; - $limit .= "$this_limit"; - $limit_cgi .= "&limit=$this_limit"; - if ($this_limit =~ /^branch:(.+)/) { - my $branchcode = $1; - my $branchname = GetBranchName($branchcode); - if (defined $branchname) { - $limit_desc .= " branch:$branchname"; - } else { - $limit_desc .= " $this_limit"; - } - } else { - $limit_desc .= " $this_limit"; - } - } + if ($this_limit){ + $limit .= " and " if $limit || $query; + $limit .= "$this_limit"; + $limit_cgi .= "&limit=$this_limit"; + if ($this_limit =~ /^branch:(.+)/) { + my $branchcode = $1; + my $branchname = GetBranchName($branchcode); + if (defined $branchname) { + $limit_desc .= " branch:$branchname"; + } + else { + $limit_desc .= " $this_limit"; + } + } + else { + $limit_desc .= " $this_limit"; + } + } + } } if ($group_OR_limits) { $limit .= " and " if ( $query || $limit ); -- 1.7.4.1