Fix for bug 1249: Searching for a title beginning with And, Or, or Not
authorkados <kados>
Wed, 9 May 2007 19:39:02 +0000 (19:39 +0000)
committerkados <kados>
Wed, 9 May 2007 19:39:02 +0000 (19:39 +0000)
results in an error

C4/Search.pm

index 78901e6..03edac1 100755 (executable)
@@ -558,6 +558,7 @@ sub buildQuery {
             my $weight_fields = C4::Context->parameters("WeightFields") || 0;
 
             if ( $operands[$i] ) {
+                       $operand =~ s/^(and|or|not)//i;
 
 # STEMMING FIXME: need to refine the field weighting so stemmed operands don't disrupt the query ranking
                 if ($stemming) {