now augmenting existing searches instead of replacing them. logging compiled search...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Nov 2007 19:18:00 +0000 (19:18 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Nov 2007 19:18:00 +0000 (19:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8068 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index a9e9bd9..1e7aa4a 100644 (file)
@@ -464,7 +464,8 @@ sub multiclass_query {
 
     $logger->debug("cleansed query string => $query");
 
-    my %search;
+    my $search = $arghash->{searches}; 
+    $arghash->{searches} = $search = {} unless $search;
 
     while ($query =~ s/((?:keyword(?:\|\w+)?|title(?:\|\w+)?|author(?:\|\w+)?|subject(?:\|\w+)?|series(?:\|\w+)?|site|dir|sort|lang|available):[^:]+)$//so) {
         my($type, $value) = split(':', $1);
@@ -496,12 +497,11 @@ sub multiclass_query {
 
         } else {
             # append the search term to the term under construction
-            $search{$type} =  {} unless $search{$type};
-            $search{$type}->{term} =  
-                ($search{$type}->{term}) ? $search{$type}->{term} . " $value" : $value;
+            $search->{$type} =  {} unless $search->{$type};
+            $search->{$type}->{term} =  
+                ($search->{$type}->{term}) ? $search->{$type}->{term} . " $value" : $value;
         }
     }
-    $arghash->{searches} = \%search;
 
     # capture the original limit because the search method alters the limit internally
     my $ol = $arghash->{limit};
@@ -512,6 +512,7 @@ sub multiclass_query {
 
     $arghash->{limit} = $ol if $ol;
     $data->{compiled_search} = $arghash;
+    $logger->info("compiled search is " . OpenSRF::Utils::JSON->perl2JSON($arghash));
     return $data;
 }
 
@@ -559,9 +560,6 @@ sub the_quest_for_knowledge {
        return { count => 0 } unless $searchhash and
                ref $searchhash->{searches} eq 'HASH';
 
-    use Data::Dumper;
-    warn Dumper($searchhash) . "\n";
-
        my $method = 'open-ils.storage.biblio.multiclass.search_fts';
        my $ismeta = 0;
        my @recs;