[open-ils-commits] [GIT] Evergreen ILS branch master updated. 7d66c78634d3b4bff7b34fcbb06031254729043c

Evergreen Git git at git.evergreen-ils.org
Tue Mar 20 12:26:51 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  7d66c78634d3b4bff7b34fcbb06031254729043c (commit)
      from  2c250783c35b84abba4edc091c95c9b67b610070 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7d66c78634d3b4bff7b34fcbb06031254729043c
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Jan 5 13:18:29 2012 -0500

    Do not exclude "identifier" facets by default
    
    No longer ignore "identifier" fields when collecting and caching
    facet data.  This change causes all config.metabib_field's that are
    marked as facet_fields to be taken into consideration.
    
    Apart from marking a field as facet_field=false, it's also possible to
    control which fields are visible within the jspac and tpac (pending LP
    911908)
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
index 6368787..189ec6c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
@@ -1477,10 +1477,6 @@ sub cache_facets {
     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
@@ -1494,29 +1490,33 @@ sub cache_facets {
     #   group by 1,2;
 
     my $count_field = $metabib ? 'metarecord' : 'source';
-    my $facets = $U->cstorereq( "open-ils.cstore.json_query.atomic",
-        {   select  => {
-                mfae => [ { column => 'field', alias => 'id'}, 'value' ],
-                mmrsm => [{
-                    transform => 'count',
-                    distinct => 1,
-                    column => $count_field,
-                    alias => 'count',
-                    aggregate => 1
-                }]
-            },
-            from    => {
-                mfae => {
-                    mmrsm => { field => 'source', fkey => 'source' },
-                    cmf   => { field => 'id', fkey => 'field' }
-                }
-            },
-            where   => {
-                '+mmrsm' => { $count_field => $results },
-                '+cmf'   => { field_class => { 'not in' => $ignore }, facet_field => 't' }
+    my $query = {   
+        select  => {
+            mfae => [ { column => 'field', alias => 'id'}, 'value' ],
+            mmrsm => [{
+                transform => 'count',
+                distinct => 1,
+                column => $count_field,
+                alias => 'count',
+                aggregate => 1
+            }]
+        },
+        from    => {
+            mfae => {
+                mmrsm => { field => 'source', fkey => 'source' },
+                cmf   => { field => 'id', fkey => 'field' }
             }
+        },
+        where   => {
+            '+mmrsm' => { $count_field => $results },
+            '+cmf'   => { facet_field => 't' }
         }
-    );
+    };
+
+    $query->{where}->{'+cmf'}->{field_class} = {'not in' => $ignore}
+        if ref($ignore) and @$ignore > 0;
+
+    my $facets = $U->cstorereq("open-ils.cstore.json_query.atomic", $query);
 
     for my $facet (@$facets) {
         next unless ($facet->{value});

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Search/Biblio.pm       |   50 ++++++++++----------
 1 files changed, 25 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list