[open-ils-commits] r18143 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Oct 3 21:05:00 EDT 2010
Author: miker
Date: 2010-10-03 21:04:59 -0400 (Sun, 03 Oct 2010)
New Revision: 18143
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Log:
Backport r18141 from trunk: Allow caller to ignore selected facet classes; ignore identifier class by default
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-10-04 00:46:18 UTC (rev 18142)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2010-10-04 01:04:59 UTC (rev 18143)
@@ -1108,6 +1108,7 @@
my $search_duration;
my $user_offset = $search_hash->{offset} || 0; # user-specified offset
my $user_limit = $search_hash->{limit} || 10;
+ my $ignore_facet_classes = $search_hash->{ignore_facet_classes};
$user_offset = ($user_offset >= 0) ? $user_offset : 0;
$user_limit = ($user_limit >= 0) ? $user_limit : 10;
@@ -1262,7 +1263,7 @@
}
);
- cache_facets($facet_key, $new_ids, $IAmMetabib) if $docache;
+ cache_facets($facet_key, $new_ids, $IAmMetabib, $ignore_facet_classes) if $docache;
return undef;
}
@@ -1368,10 +1369,14 @@
sub cache_facets {
# add facets for this search to the facet cache
- my($key, $results, $metabib) = @_;
+ my($key, $results, $metabib, $ignore) = @_;
my $data = $cache->get_cache($key);
$data ||= {};
+ if (!ref($ignore)) {
+ $ignore = ['identifier']; # ignore the identifier class by default
+ }
+
return undef unless (@$results);
# The query we're constructing
@@ -1398,11 +1403,13 @@
},
from => {
mfae => {
- mmrsm => { field => 'source', fkey => 'source' }
+ mmrsm => { field => 'source', fkey => 'source' },
+ cmf => { field => 'id', fkey => 'field' }
}
},
where => {
- '+mmrsm' => { $count_field => $results }
+ '+mmrsm' => { $count_field => $results },
+ '+cmf' => { field_class => { 'not in' => $ignore } }
}
}
);
More information about the open-ils-commits
mailing list