Bug 11232: (followup) Configuration variable for enabling Zebra facets
authorTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 15 Oct 2014 13:28:44 +0000 (10:28 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 15 Oct 2014 15:55:45 +0000 (12:55 -0300)
This patch adds a variable to koha-conf.xml controlling the use of Zebra facets.

Usage:
 - use_zebra_facets = 1 | 0

Zebra facets work only on DOM.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Search.pm
debian/templates/koha-conf-site.xml.in
etc/koha-conf.xml

index 7abe096..ed9538f 100644 (file)
@@ -634,9 +634,11 @@ sub GetFacets {
     my $rs = shift;
     my $facets;
 
-    my $index_mode = C4::Context->config('zebra_auth_index_mode') // 'dom';
+    my $indexing_mode    = C4::Context->config('zebra_bib_index_mode') // 'dom';
+    my $use_zebra_facets = C4::Context->config('use_zebra_facets') // 0;
 
-    if ( $index_mode eq 'dom' ) {
+    if ( $indexing_mode eq 'dom' &&
+         $use_zebra_facets ) {
         $facets = _get_facets_from_zebra( $rs );
     } else {
         $facets = _get_facets_from_records( $rs );
index 371b1d2..1892960 100644 (file)
  <zebra_bib_index_mode>__BIBLIOS_INDEXING_MODE__</zebra_bib_index_mode>
  <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
  <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
+ <use_zebra_facets>1</use_zebra_facets>
  <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
 </config>
 
index 534bd13..0392fb8 100644 (file)
@@ -112,6 +112,7 @@ __PAZPAR2_TOGGLE_XML_POST__
  <zebra_bib_index_mode>__BIB_INDEX_MODE__</zebra_bib_index_mode>
  <zebra_auth_index_mode>__AUTH_INDEX_MODE__</zebra_auth_index_mode>
  <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
+ <use_zebra_facets>1</use_zebra_facets>
  <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
 
  <!-- true type font mapping accoding to type from $font_types in C4/Creators/Lib.pm -->