From b6741543b6055b59b1fc04d25bb73df74c702e54 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 6 Mar 2018 13:29:22 -0500 Subject: [PATCH] Bug 18909 - Enable the maximum zebra records size to be specified per instance The default for Zebra is to not return results where the record size is greater than 1045 KB ( 1 MB ). Some libraries need to increase this ceiling, but it may come at a cost with z39.50 compatibility with other services. For that reason, we should make this setting configurable on a per-instance basis. Test Plan: 1) Apply this patch 2) Build a Debian package 3) Specify a zebra_max_record_size of 2048 in your koha_conf.xml 4) Restart zebra 5) Index a record greater than 1 MB but smaller than 2 MB 6) Note that it is searchable! --- debian/scripts/koha-functions.sh | 11 +++++++++++ debian/scripts/koha-zebra | 2 ++ debian/templates/koha-conf-site.xml.in | 1 + 3 files changed, 14 insertions(+) diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh index 6e189b6..c6f79b4 100755 --- a/debian/scripts/koha-functions.sh +++ b/debian/scripts/koha-functions.sh @@ -254,6 +254,17 @@ get_loglevels() fi } +get_max_record_size() +{ + local instancename=$1 + local retval=$(xmlstarlet sel -t -v 'yazgfs/config/zebra_max_record_size' /etc/koha/sites/$instancename/koha-conf.xml) + if [ "$retval" != "" ]; then + echo "$retval" + else + echo "1024" + fi +} + get_tmpdir() { if [ "$TMPDIR" != "" ]; then diff --git a/debian/scripts/koha-zebra b/debian/scripts/koha-zebra index 944e2e1..e1a2629 100755 --- a/debian/scripts/koha-zebra +++ b/debian/scripts/koha-zebra @@ -61,6 +61,7 @@ start_zebra() # get zebra log levels from koha-conf.xml local loglevels=$(get_loglevels ${name}) + local max_record_size=$(get_max_record_size ${name}) if ! is_zebra_running $name; then @@ -76,6 +77,7 @@ start_zebra() --user=${name}-koha.${name}-koha" ZEBRA_PARAMS="-v $loglevels \ + -k $max_record_size \ -f /etc/koha/sites/${name}/koha-conf.xml" [ "$verbose" != "no" ] && \ diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 85b54a9..e61f72d 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -282,6 +282,7 @@ __END_SRU_PUBLICSERVER__ __AUTHORITIES_INDEXING_MODE__ /var/lock/koha/__KOHASITE__ 1 + 1024 /etc/koha/searchengine/queryparser.yaml __KOHA_CONF_DIR__/log4perl.conf