[open-ils-commits] r16259 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Search (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 16 16:05:01 EDT 2010
Author: miker
Date: 2010-04-16 16:04:56 -0400 (Fri, 16 Apr 2010)
New Revision: 16259
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Log:
get MR facets when we are doing an MR search ... duh. also need to adjust how we count. later
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-04-16 18:51:53 UTC (rev 16258)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-04-16 20:04:56 UTC (rev 16259)
@@ -1178,7 +1178,8 @@
}
);
- cache_facets($facet_key, $new_ids) if $docache;
+ cache_facets($facet_key, $new_ids, ($self->api_name =~ /metabib/) ? 1 : 0) if $docache;
+
return undef;
}
@@ -1215,7 +1216,7 @@
sub cache_facets {
# add facets for this search to the facet cache
- my($key, $results) = @_;
+ my($key, $results, $metabib) = @_;
my $data = $cache->get_cache($key);
$data ||= {};
@@ -1232,6 +1233,14 @@
# and mfae.source in IDLIST
# group by 1,2;
+ if ($metabib) {
+ $results = {
+ select => { mmrsm => [ 'source' ] },
+ from => 'mmrsm',
+ where => { metarecord => $results }
+ };
+ }
+
my $facets = $U->cstorereq( "open-ils.cstore.json_query.atomic",
{ select => {
cmf => [ 'id' ],
@@ -1247,7 +1256,7 @@
]
},
from => { mfae => 'cmf' },
- where => { '+cmf' => 'facet_field', '+mfae' => { source => $results } }
+ where => { '+cmf' => 'facet_field', '+mfae' => { source => { in => $results } } }
}
);
More information about the open-ils-commits
mailing list