Bug 4074 Fix fail to parse simple qualified search
authorColin Campbell <colin.campbell@ptfs-europe.com>
Wed, 17 Nov 2010 00:33:38 +0000 (19:33 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 17 Nov 2010 04:03:04 +0000 (17:03 +1300)
Searches such as au,phr and kw,wrdl were passing through the regexes
that should replace colon with equals
add wrdl and phr
use trn so not just rtrn is spotted
Where we were checking for multiple spaces specify that in the
regex not just two spaces

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Search.pm

index d36459a..93999bb 100644 (file)
@@ -1308,10 +1308,11 @@ sub buildQuery {
     # if user wants to do ccl or cql, start the query with that
 #    $query =~ s/:/=/g;
     $query =~ s/(?<=(ti|au|pb|su|an|kw|mc)):/=/g;
-    $query =~ s/(?<=rtrn):/=/g;
+    $query =~ s/(?<=(wrdl)):/=/g;
+    $query =~ s/(?<=(trn|phr)):/=/g;
     $limit =~ s/:/=/g;
     for ( $query, $query_desc, $limit, $limit_desc ) {
-        s/  / /g;    # remove extra spaces
+        s/  +/ /g;    # remove extra spaces
         s/^ //g;     # remove any beginning spaces
         s/ $//g;     # remove any ending spaces
         s/==/=/g;    # remove double == from query