pass the default search class correctly, instead of rewriting the query (possibly...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 30 Mar 2009 00:19:37 +0000 (00:19 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 30 Mar 2009 00:19:37 +0000 (00:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4_0@12720 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm

index 3ff86cf..f618c3e 100644 (file)
@@ -522,6 +522,8 @@ sub multiclass_query {
         # This is the front part of the string before any special tokens were parsed. 
         # Add this data to the default search class
         my $type = $arghash->{default_class} || 'keyword';
+        $type = ($type eq '-') ? 'keyword' : $type;
+        $type = ($type !~ /^(title|author|keyword|subject|series)$/o) ? 'keyword' : $type;
         $search->{$type} =  {} unless $search->{$type};
         $search->{$type}->{term} =
             ($search->{$type}->{term}) ? $search->{$type}->{term} . " $query" : $query;
index 3fb47a8..d98500f 100644 (file)
@@ -970,9 +970,6 @@ sub opensearch_feed {
        $terms .= $cgi->param('searchTerms') if $cgi->param('searchTerms');
 
        $class = $cgi->param('searchClass') if $cgi->param('searchClass');
-       if ($class && $terms !~ m/^$class:/o) {
-               $terms =~ s{^(\S*:)?\s*}{$class: }o;
-       }
        $class ||= '-';
 
        $type = $cgi->param('responseType') if $cgi->param('responseType');
@@ -1033,6 +1030,7 @@ sub opensearch_feed {
                        limit           => $limit,
                        sort            => $sort,
                        sort_dir        => $sortdir,
+            default_class => $class,
                        ($lang ?    ( 'language' => $lang    ) : ()),
                } => $terms => 1
        )->gather(1);