LP1183357 Pass locale to bib search (tpac)
authorBill Erickson <berick@esilibrary.com>
Thu, 23 May 2013 13:43:52 +0000 (09:43 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 29 May 2013 19:45:23 +0000 (15:45 -0400)
Pass the TPAC locale value, which is collected at each page load, to the
bib search API call.  This allows us to take advantage of language-based
relevance bumps.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm

index dea0145..8d81cf5 100644 (file)
@@ -417,8 +417,12 @@ sub load_rresults {
             my $method = 'open-ils.search.biblio.multiclass.query';
             $method .= '.staff' if $ctx->{is_staff};
 
+            my $ses = OpenSRF::AppSession->create('open-ils.search');
+            $ses->session_locale($OpenILS::Utils::CStoreEditor::default_locale); # set in EGWeb
+
             $self->timelog("Firing off the multiclass query");
-            $results = $U->simplereq('open-ils.search', $method, $args, $query, 1);
+            my $req = $ses->request($method, $args, $query, 1);
+            $results = $req->gather(1);
             $self->timelog("Returned from the multiclass query");
 
         } catch Error with {