[open-ils-commits] r8068 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Search

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 15 14:34:52 EST 2007


Author: erickson
Date: 2007-11-15 14:18:00 -0500 (Thu, 15 Nov 2007)
New Revision: 8068

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Log:
now augmenting existing searches instead of replacing them.  logging compiled search.  removed old warn statement

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2007-11-15 05:39:43 UTC (rev 8067)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2007-11-15 19:18:00 UTC (rev 8068)
@@ -464,7 +464,8 @@
 
     $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 @@
 
         } 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 @@
 
     $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 @@
 	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;



More information about the open-ils-commits mailing list