From: miker Date: Mon, 30 Mar 2009 00:19:37 +0000 (+0000) Subject: pass the default search class correctly, instead of rewriting the query (possibly... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2fae37e43e9fda1e84aabf2beaaa7cd49a3ff98d;p=Evergreen.git pass the default search class correctly, instead of rewriting the query (possibly causing user confusion); require a valid class be passed to the middle layer code git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4_0@12720 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 3ff86cf8c2..f618c3ee6e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -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; diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 3fb47a802a..d98500fbd4 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -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);