View | Details | Raw Unified | Return to bug 14302
Collapse All | Expand All

(-)a/C4/Context.pm (-10 / +2 lines)
Lines 618-633 sub _new_Zconn { Link Here
618
        $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom';
618
        $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom';
619
    }
619
    }
620
620
621
    if ( $index_mode eq 'grs1' ) {
621
    $syntax = 'xml';
622
        $elementSetName = 'F';
622
    $elementSetName = 'marcxml';
623
        $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' )
624
                ? 'unimarc'
625
                : 'usmarc';
626
627
    } else { # $index_mode eq 'dom'
628
        $syntax = 'xml';
629
        $elementSetName = 'marcxml';
630
    }
631
623
632
    my $host = $context->{'listen'}->{$server}->{'content'};
624
    my $host = $context->{'listen'}->{$server}->{'content'};
633
    my $user = $context->{"serverinfo"}->{$server}->{"user"};
625
    my $user = $context->{"serverinfo"}->{$server}->{"user"};
(-)a/Makefile.PL (-56 / +4 lines)
Lines 91-98 Makefile.PL - Koha packager and installer Link Here
91
    --zebra_sru_host             Zebra SRU servername (e.g. localhost)
91
    --zebra_sru_host             Zebra SRU servername (e.g. localhost)
92
    --zebra_sru_biblios_port     Zebra SRU biblios port (e.g. 9998)
92
    --zebra_sru_biblios_port     Zebra SRU biblios port (e.g. 9998)
93
    --zebra_sru_authorities_port Zebra SRU biblios port (e.g. 9999)
93
    --zebra_sru_authorities_port Zebra SRU biblios port (e.g. 9999)
94
    --auth_index_mode            Authority index mode (grs1, dom)
95
    --bib_index_mode             Bibliographic index mode (grs1, dom)
96
    --koha_user                  Koha Unix user (e.g. koha)
94
    --koha_user                  Koha Unix user (e.g. koha)
97
    --koha_group                 Koha Unix group (e.g. koha)
95
    --koha_group                 Koha Unix group (e.g. koha)
98
    --install_sru                Install the SRU server (yes, no)
96
    --install_sru                Install the SRU server (yes, no)
Lines 465-472 my %config_defaults = ( Link Here
465
  'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
463
  'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
466
  'INSTALL_SRU'       => 'yes',
464
  'INSTALL_SRU'       => 'yes',
467
  'INSTALL_PAZPAR2'   => 'no',
465
  'INSTALL_PAZPAR2'   => 'no',
468
  'AUTH_INDEX_MODE'   => 'dom',
469
  'BIB_INDEX_MODE'    => 'dom',
470
  'ZEBRA_MARC_FORMAT' => 'marc21',
466
  'ZEBRA_MARC_FORMAT' => 'marc21',
471
  'ZEBRA_LANGUAGE'    => 'en',
467
  'ZEBRA_LANGUAGE'    => 'en',
472
  'ZEBRA_TOKENIZER'   => 'chr',
468
  'ZEBRA_TOKENIZER'   => 'chr',
Lines 512-519 my %valid_config_values = ( Link Here
512
  'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
508
  'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
513
  'DB_USE_TLS' => {'yes', 'no'},
509
  'DB_USE_TLS' => {'yes', 'no'},
514
  'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
510
  'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
515
  'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 },
516
  'BIB_INDEX_MODE'  => { 'grs1' => 1, 'dom' => 1 },
517
  'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
511
  'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
518
  'ZEBRA_LANGUAGE'    => { 'cs' => 1, 'en' => 1, 'es' => 1, 'fr' => 1, 'gr' => 1, 'nb' => 1, 'ru' => 1, 'uk' => 1 }, # FIXME should generate from contents of distribution
512
  'ZEBRA_LANGUAGE'    => { 'cs' => 1, 'en' => 1, 'es' => 1, 'fr' => 1, 'gr' => 1, 'nb' => 1, 'ru' => 1, 'uk' => 1 }, # FIXME should generate from contents of distribution
519
  'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 },
513
  'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 },
Lines 538-545 my $cli_zebra_pass = ""; Link Here
538
my $cli_zebra_sru_host = "";
532
my $cli_zebra_sru_host = "";
539
my $cli_zebra_sru_bib_port = "";
533
my $cli_zebra_sru_bib_port = "";
540
my $cli_zebra_sru_auth_port = "";
534
my $cli_zebra_sru_auth_port = "";
541
my $cli_koha_auth_index_mode = "";
542
my $cli_koha_bib_index_mode = "";
543
my $cli_koha_user = "";
535
my $cli_koha_user = "";
544
my $cli_koha_group = "";
536
my $cli_koha_group = "";
545
my $cli_koha_install_sru = "";
537
my $cli_koha_install_sru = "";
Lines 567-574 my $results = GetOptions( Link Here
567
    "zebra_sru_host=s"             => \$cli_zebra_sru_host,
559
    "zebra_sru_host=s"             => \$cli_zebra_sru_host,
568
    "zebra_sru_biblios_port=s"     => \$cli_zebra_sru_bib_port,
560
    "zebra_sru_biblios_port=s"     => \$cli_zebra_sru_bib_port,
569
    "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port,
561
    "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port,
570
    "auth_index_mode=s"            => \$cli_koha_auth_index_mode,
571
    "bib_index_mode=s"             => \$cli_koha_bib_index_mode,
572
    "koha_user=s"                  => \$cli_koha_user,
562
    "koha_user=s"                  => \$cli_koha_user,
573
    "koha_group=s"                 => \$cli_koha_group,
563
    "koha_group=s"                 => \$cli_koha_group,
574
    "install_sru=s"                => \$cli_koha_install_sru,
564
    "install_sru=s"                => \$cli_koha_install_sru,
Lines 610-624 my $pl_files = { Link Here
610
600
611
push @{ $pl_files->{'rewrite-config.PL'} }, (
601
push @{ $pl_files->{'rewrite-config.PL'} }, (
612
    'blib/ZEBRA_CONF_DIR/etc/passwd',
602
    'blib/ZEBRA_CONF_DIR/etc/passwd',
613
    'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg',
614
    'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
603
    'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
615
    'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg',
616
    'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg',
604
    'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg',
617
    'blib/ZEBRA_CONF_DIR/explain-authorities.xml',
605
    'blib/ZEBRA_CONF_DIR/explain-authorities.xml',
618
    'blib/ZEBRA_CONF_DIR/explain-biblios.xml',
606
    'blib/ZEBRA_CONF_DIR/explain-biblios.xml',
619
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml',
620
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
607
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
621
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-grs1.xml',
622
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml',
608
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml',
623
);
609
);
624
push @{ $pl_files->{'rewrite-config.PL'} }, (
610
push @{ $pl_files->{'rewrite-config.PL'} }, (
Lines 632-650 if ($config{'INSTALL_PAZPAR2'} eq 'yes') { Link Here
632
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
618
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
633
    );
619
    );
634
}
620
}
635
$config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom'
621
$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg';
636
                              ? 'zebra-authorities-dom.cfg'
622
$config{'ZEBRA_BIB_CFG'}  = 'zebra-biblios-dom.cfg';
637
                              : 'zebra-authorities.cfg';
623
$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml';
638
$config{'ZEBRA_BIB_CFG'}  = $config{'BIB_INDEX_MODE'} eq 'dom'
624
$config{'BIB_RETRIEVAL_CFG'}  = 'retrieval-info-bib-dom.xml';
639
                              ? 'zebra-biblios-dom.cfg'
640
                              : 'zebra-biblios.cfg';
641
$config{'AUTH_RETRIEVAL_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom'
642
                                  ? 'retrieval-info-auth-dom.xml'
643
                                  : 'retrieval-info-auth-grs1.xml';
644
$config{'BIB_RETRIEVAL_CFG'}  = $config{'BIB_INDEX_MODE'} eq 'dom'
645
                                  ? 'retrieval-info-bib-dom.xml'
646
                                  : 'retrieval-info-bib-grs1.xml';
647
648
625
649
if ($config{'INSTALL_MODE'} ne "dev") {
626
if ($config{'INSTALL_MODE'} ne "dev") {
650
    push @{ $pl_files->{'rewrite-config.PL'} }, (
627
    push @{ $pl_files->{'rewrite-config.PL'} }, (
Lines 856-863 sub get_cli_values { Link Here
856
        ZEBRA_SRU_HOST             => $cli_zebra_sru_host,
833
        ZEBRA_SRU_HOST             => $cli_zebra_sru_host,
857
        ZEBRA_SRU_BIBLIOS_PORT     => $cli_zebra_sru_bib_port,
834
        ZEBRA_SRU_BIBLIOS_PORT     => $cli_zebra_sru_bib_port,
858
        ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port,
835
        ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port,
859
        AUTH_INDEX_MODE            => $cli_koha_auth_index_mode,
860
        BIB_INDEX_MODE             => $cli_koha_bib_index_mode,
861
        KOHA_USER                  => $cli_koha_user,
836
        KOHA_USER                  => $cli_koha_user,
862
        KOHA_GROUP                 => $cli_koha_group,
837
        KOHA_GROUP                 => $cli_koha_group,
863
        INSTALL_SRU                => $cli_koha_install_sru,
838
        INSTALL_SRU                => $cli_koha_install_sru,
Lines 1116-1148 Primary language for Zebra indexing); Link Here
1116
    $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
1091
    $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
1117
1092
1118
    $msg = q(
1093
    $msg = q(
1119
Koha can use one of  two different indexing modes
1120
for the MARC bibliographic records:
1121
1122
dom  - uses the DOM XML filter; offers improved
1123
       functionality.
1124
grs1 - [DEPRECATED] uses the Zebra GRS-1 filter,
1125
       available for legacy support
1126
1127
Bibliographic indexing mode);
1128
    $msg .= _add_valid_values_disp('BIB_INDEX_MODE', $valid_values);
1129
    $config{'BIB_INDEX_MODE'} = _get_value('BIB_INDEX_MODE', $msg, $defaults->{'BIB_INDEX_MODE'}, $valid_values, $install_log_values);
1130
1131
1132
    $msg = q(
1133
Koha can use one of  two different indexing modes
1134
for the MARC authorities records:
1135
1136
dom  - uses the DOM XML filter; offers improved
1137
       functionality.
1138
grs1 - [DEPRECATED] uses the Zebra GRS-1 filter,
1139
       available for legacy support
1140
1141
Authorities indexing mode);
1142
    $msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values);
1143
    $config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values);
1144
1145
    $msg = q(
1146
Zebra has two methods to perform records tokenization
1094
Zebra has two methods to perform records tokenization
1147
and characters normalization: CHR and ICU. ICU is
1095
and characters normalization: CHR and ICU. ICU is
1148
recommended for catalogs containing non-Latin
1096
recommended for catalogs containing non-Latin
(-)a/about.pl (-64 / +8 lines)
Lines 140-197 my @xml_config_warnings; Link Here
140
140
141
my $context = new C4::Context;
141
my $context = new C4::Context;
142
142
143
if ( ! defined C4::Context->config('zebra_bib_index_mode') ) {
143
if (    C4::Context->config('zebra_bib_index_mode')
144
    push @xml_config_warnings, {
144
    and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
145
        error => 'zebra_bib_index_mode_warn'
145
{
146
    };
146
    push @xml_config_warnings, { error => 'zebra_bib_index_mode_is_grs1' };
147
    if ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) {
148
        push @xml_config_warnings, {
149
            error => 'zebra_bib_mode_seems_grs1'
150
        };
151
    }
152
    else {
153
        push @xml_config_warnings, {
154
            error => 'zebra_bib_mode_seems_dom'
155
        };
156
    }
157
} else {
158
    push @xml_config_warnings, { error => 'zebra_bib_grs_warn' }
159
        if C4::Context->config('zebra_bib_index_mode') eq 'grs1';
160
}
161
162
if ( (C4::Context->config('zebra_bib_index_mode') eq 'dom') &&
163
     ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) ) {
164
165
    push @xml_config_warnings, {
166
        error => 'zebra_bib_index_mode_mismatch_warn'
167
    };
168
}
169
170
if ( (C4::Context->config('zebra_bib_index_mode') eq 'grs1') &&
171
     ($context->{'server'}->{'biblioserver'}->{'config'} =~ /zebra-biblios-dom.cfg/) ) {
172
173
    push @xml_config_warnings, {
174
        error => 'zebra_bib_index_mode_mismatch_warn'
175
    };
176
}
147
}
177
148
178
if ( ! defined C4::Context->config('zebra_auth_index_mode') ) {
149
if (    C4::Context->config('zebra_auth_index_mode')
179
    push @xml_config_warnings, {
150
    and C4::Context->config('zebra_auth_index_mode') eq 'grs1' )
180
        error => 'zebra_auth_index_mode_warn'
151
{
181
    };
152
    push @xml_config_warnings, { error => 'zebra_auth_index_mode_is_grs1' };
182
    if ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) {
183
        push @xml_config_warnings, {
184
            error => 'zebra_auth_mode_seems_grs1'
185
        };
186
    }
187
    else {
188
        push @xml_config_warnings, {
189
            error => 'zebra_auth_mode_seems_dom'
190
        };
191
    }
192
} else {
193
    push @xml_config_warnings, { error => 'zebra_auth_grs_warn' }
194
        if C4::Context->config('zebra_auth_index_mode') eq 'grs1';
195
}
153
}
196
154
197
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
155
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
Lines 200-211 if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'ser Link Here
200
    };
158
    };
201
}
159
}
202
160
203
if ( (C4::Context->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'authorityserver'}->{'config'} =~ /zebra-authorities-dom.cfg/) ) {
204
    push @xml_config_warnings, {
205
        error => 'zebra_auth_index_mode_mismatch_warn'
206
    };
207
}
208
209
if ( ! defined C4::Context->config('log4perl_conf') ) {
161
if ( ! defined C4::Context->config('log4perl_conf') ) {
210
    push @xml_config_warnings, {
162
    push @xml_config_warnings, {
211
        error => 'log4perl_entry_missing'
163
        error => 'log4perl_entry_missing'
Lines 257-270 if ( C4::Context->preference( 'UseQueryParser' ) ) { Link Here
257
# Test Zebra facets configuration
209
# Test Zebra facets configuration
258
if ( !defined C4::Context->config('use_zebra_facets') ) {
210
if ( !defined C4::Context->config('use_zebra_facets') ) {
259
    push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
211
    push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
260
} else {
261
    if ( C4::Context->config('use_zebra_facets') &&
262
         C4::Context->config('zebra_bib_index_mode') ) {
263
        # use_zebra_facets works with DOM
264
        push @xml_config_warnings, {
265
            error => 'use_zebra_facets_needs_dom'
266
        } if C4::Context->config('zebra_bib_index_mode') ne 'dom' ;
267
    }
268
}
212
}
269
213
270
# ILL module checks
214
# ILL module checks
(-)a/debian/koha-common.postinst (-1 / +1 lines)
Lines 136-142 fi Link Here
136
# that we're fixing them from is there, so we just run it every time. Maybe
136
# that we're fixing them from is there, so we just run it every time. Maybe
137
# in many years time we can get rid of this, when no one will be running
137
# in many years time we can get rid of this, when no one will be running
138
# Koha < 3.20.
138
# Koha < 3.20.
139
for zfile in $( find /etc/koha/sites -name zebra-authorities.cfg -or -name zebra-authorities-dom.cfg -or -name zebra-biblios.cfg -or -name zebra-biblios-dom.cfg ); do
139
for zfile in $( find /etc/koha/sites-name zebra-authorities-dom.cfg -or -name zebra-biblios-dom.cfg ); do
140
    perl -p -i -e 's{^modulePath: /usr/lib/idzebra-2.0/modules$}{modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules}' $zfile
140
    perl -p -i -e 's{^modulePath: /usr/lib/idzebra-2.0/modules$}{modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules}' $zfile
141
done
141
done
142
142
(-)a/debian/koha.install (-3 / +1 lines)
Lines 1-7 Link Here
1
debian/tmp/etc/apache2
1
debian/tmp/etc/apache2
2
debian/tmp/etc/koha/koha-httpd.conf
2
debian/tmp/etc/koha/koha-httpd.conf
3
debian/tmp/var
3
debian/tmp/var
4
debian/tmp/etc/koha/zebradb/zebra-biblios.cfg
5
debian/tmp/etc/koha/zebradb/zebra-authorities.cfg
6
debian/tmp/etc/koha/zebradb/zebra-authorities-dom.cfg
4
debian/tmp/etc/koha/zebradb/zebra-authorities-dom.cfg
7
debian/tmp/etc/koha/zebradb/zebra-biblios-dom.cfg
5
debian/tmp/etc/koha/zebradb/zebra-biblios-dom.cfg
(-)a/debian/scripts/koha-create (-64 / +10 lines)
Lines 100-107 generate_config_file() { Link Here
100
        -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \
100
        -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \
101
        -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \
101
        -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \
102
        -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \
102
        -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \
103
        -e "s/__BIBLIOS_INDEXING_MODE__/$BIBLIOS_INDEXING_MODE/g" \
104
        -e "s/__AUTHORITIES_INDEXING_MODE__/$AUTHORITIES_INDEXING_MODE/g" \
105
        -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
103
        -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
106
        -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
104
        -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
107
        -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
105
        -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
Lines 219-289 EOM Link Here
219
217
220
set_biblios_indexing_mode()
218
set_biblios_indexing_mode()
221
{
219
{
222
    local indexing_mode=$1
220
    local marc_format=$1
223
    local marc_format=$2
224
221
225
    case $indexing_mode in
222
    START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
226
        "dom")
227
            START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
228
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
223
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
229
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
224
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
230
     <xi:fallback>\n
225
     <xi:fallback>\n
231
      <retrievalinfo>
226
      <retrievalinfo>
232
EOF`
227
EOF`
233
228
234
            END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
229
    END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
235
      <\/retrievalinfo>\n
230
      <\/retrievalinfo>\n
236
     <\/xi:fallback>\n
231
     <\/xi:fallback>\n
237
    <\/xi:include>
232
    <\/xi:include>
238
EOF`
233
EOF`
239
            BIBLIOS_INDEXING_MODE="dom"
234
    ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
240
            ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
241
            ;;
242
        "grs1")
243
            START_BIBLIOS_RETRIEVAL_INFO="    <retrievalinfo>"
244
            END_BIBLIOS_RETRIEVAL_INFO="    <\/retrievalinfo>"
245
            BIBLIOS_INDEXING_MODE="grs1"
246
            ZEBRA_BIBLIOS_CFG="zebra-biblios.cfg"
247
            ;;
248
        *)
249
            die "Error: '$indexing_mode' is not a valid indexing mode for bibliographic records."
250
            ;;
251
    esac
252
}
235
}
253
236
254
237
255
set_authorities_indexing_mode()
238
set_authorities_indexing_mode()
256
{
239
{
257
    local indexing_mode=$1
240
    local marc_format=$1
258
    local marc_format=$2
259
241
260
    case $indexing_mode in
242
    START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
261
        "dom")
262
            START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
263
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
243
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
264
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
244
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
265
     <xi:fallback>\n
245
     <xi:fallback>\n
266
      <retrievalinfo>
246
      <retrievalinfo>
267
EOF`
247
EOF`
268
248
269
            END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
249
    END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
270
      <\/retrievalinfo>\n
250
      <\/retrievalinfo>\n
271
     <\/xi:fallback>\n
251
     <\/xi:fallback>\n
272
    <\/xi:include>\n
252
    <\/xi:include>\n
273
EOF`
253
EOF`
274
            AUTHORITIES_INDEXING_MODE="dom"
254
    ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
275
            ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
276
            ;;
277
        "grs1")
278
            START_AUTHORITIES_RETRIEVAL_INFO="    <retrievalinfo>"
279
            END_AUTHORITIES_RETRIEVAL_INFO="    <\/retrievalinfo>"
280
            AUTHORITIES_INDEXING_MODE="grs1"
281
            ZEBRA_AUTHORITIES_CFG="zebra-authorities.cfg"
282
            ;;
283
        *)
284
            die "Error: '$indexing_mode' is not a valid indexing mode for authority records."
285
            ;;
286
    esac
287
}
255
}
288
256
289
257
Lines 421-430 DEFAULT_SRU_SERVER_PORT="7090" Link Here
421
START_SRU_PUBLICSERVER="<!--"
389
START_SRU_PUBLICSERVER="<!--"
422
END_SRU_PUBLICSERVER="-->"
390
END_SRU_PUBLICSERVER="-->"
423
391
424
# Indexing mode variables (default is DOM)
425
BIBLIOS_INDEXING_MODE="dom"
426
AUTHORITIES_INDEXING_MODE="dom"
427
428
START_BIBLIOS_RETRIEVAL_INFO=""
392
START_BIBLIOS_RETRIEVAL_INFO=""
429
END_BIBLIOS_RETRIEVAL_INFO=""
393
END_BIBLIOS_RETRIEVAL_INFO=""
430
START_AUTHORITIES_RETRIEVAL_INFO=""
394
START_AUTHORITIES_RETRIEVAL_INFO=""
Lines 450-457 CLO_ZEBRA_MARC_FORMAT="" Link Here
450
CLO_ZEBRA_LANGUAGE=""
414
CLO_ZEBRA_LANGUAGE=""
451
CLO_DEFAULTSQL=""
415
CLO_DEFAULTSQL=""
452
CLO_ADMINUSER=""
416
CLO_ADMINUSER=""
453
CLO_BIBLIOS_INDEXING_MODE=""
454
CLO_AUTHORITIES_INDEXING_MODE=""
455
CLO_MEMCACHED_SERVERS=""
417
CLO_MEMCACHED_SERVERS=""
456
CLO_MEMCACHED_PREFIX=""
418
CLO_MEMCACHED_PREFIX=""
457
CLO_UPLOAD_PATH=""
419
CLO_UPLOAD_PATH=""
Lines 478-487 while true ; do Link Here
478
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
440
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
479
        -l|--zebralang)
441
        -l|--zebralang)
480
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
442
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
481
        --auth-idx)
482
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
483
        --biblio-idx)
484
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
485
        -d|--defaultsql)
443
        -d|--defaultsql)
486
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
444
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
487
        -f|--configfile)
445
        -f|--configfile)
Lines 546-566 then Link Here
546
    PASSWDFILE="$CLO_PASSWDFILE"
504
    PASSWDFILE="$CLO_PASSWDFILE"
547
fi
505
fi
548
506
549
if [ "$CLO_BIBLIOS_INDEXING_MODE" !=  "" ]; then
507
set_biblios_indexing_mode $ZEBRA_MARC_FORMAT
550
    BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE
551
fi
552
553
set_biblios_indexing_mode $BIBLIOS_INDEXING_MODE $ZEBRA_MARC_FORMAT
554
508
555
if [ "$ENABLE_SRU" != "no" ]; then
509
if [ "$ENABLE_SRU" != "no" ]; then
556
    enable_sru_server
510
    enable_sru_server
557
fi
511
fi
558
512
559
if [ "$CLO_AUTHORITIES_INDEXING_MODE" !=  "" ]; then
513
set_authorities_indexing_mode $ZEBRA_MARC_FORMAT
560
    AUTHORITIES_INDEXING_MODE=$CLO_AUTHORITIES_INDEXING_MODE
561
fi
562
563
set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT
564
514
565
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
515
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
566
516
Lines 732-743 eof Link Here
732
        "/etc/koha/sites/$name/log4perl.conf"
682
        "/etc/koha/sites/$name/log4perl.conf"
733
683
734
    # Generate and install Zebra config files.
684
    # Generate and install Zebra config files.
735
    generate_config_file zebra-biblios-site.cfg.in \
736
        "/etc/koha/sites/$name/zebra-biblios.cfg"
737
    generate_config_file zebra-biblios-dom-site.cfg.in \
685
    generate_config_file zebra-biblios-dom-site.cfg.in \
738
        "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
686
        "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
739
    generate_config_file zebra-authorities-site.cfg.in \
740
        "/etc/koha/sites/$name/zebra-authorities.cfg"
741
    generate_config_file zebra-authorities-dom-site.cfg.in \
687
    generate_config_file zebra-authorities-dom-site.cfg.in \
742
        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
688
        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
743
    generate_config_file zebra.passwd.in \
689
    generate_config_file zebra.passwd.in \
(-)a/debian/templates/koha-conf-site.xml.in (-2 lines)
Lines 278-285 __END_SRU_PUBLICSERVER__ Link Here
278
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
278
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
279
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
279
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
280
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
280
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
281
 <zebra_bib_index_mode>__BIBLIOS_INDEXING_MODE__</zebra_bib_index_mode>
282
 <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
283
 <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
281
 <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
284
 <use_zebra_facets>1</use_zebra_facets>
282
 <use_zebra_facets>1</use_zebra_facets>
285
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
283
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
(-)a/debian/templates/koha-sites.conf (-10 lines)
Lines 32-47 ZEBRA_MARC_FORMAT="marc21" Link Here
32
# default: 'en'
32
# default: 'en'
33
ZEBRA_LANGUAGE="en"
33
ZEBRA_LANGUAGE="en"
34
34
35
# BIBLIOS_INDEXING_MODE: 'dom' | 'grs1'
36
# Indexing mode for bibliographic records
37
# default: 'dom'
38
BIBLIOS_INDEXING_MODE="dom"
39
40
# AUTHORITIES_INDEXING_MODE: 'dom' | 'grs1'
41
# Indexing mode for authority records
42
# default: 'dom'
43
AUTHORITIES_INDEXING_MODE="dom"
44
45
## Memcached global configuration variables
35
## Memcached global configuration variables
46
#
36
#
47
# USE_MEMCACHED: 'yes' | 'no'
37
# USE_MEMCACHED: 'yes' | 'no'
(-)a/etc/koha-conf.xml (-2 lines)
Lines 114-121 __PAZPAR2_TOGGLE_XML_POST__ Link Here
114
 <install_log>__MISC_DIR__/koha-install-log</install_log>
114
 <install_log>__MISC_DIR__/koha-install-log</install_log>
115
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
115
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
116
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
116
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
117
 <zebra_bib_index_mode>__BIB_INDEX_MODE__</zebra_bib_index_mode>
118
 <zebra_auth_index_mode>__AUTH_INDEX_MODE__</zebra_auth_index_mode>
119
 <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
117
 <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
120
 <use_zebra_facets>1</use_zebra_facets>
118
 <use_zebra_facets>1</use_zebra_facets>
121
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
119
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-59 / +4 lines)
Lines 276-345 Link Here
276
            <table>
276
            <table>
277
                <caption>XML configuration file</caption>
277
                <caption>XML configuration file</caption>
278
            [% FOREACH config_entry IN xml_config_warnings %]
278
            [% FOREACH config_entry IN xml_config_warnings %]
279
                [% IF config_entry.error == 'zebra_bib_index_mode_warn' %]
279
                [% IF config_entry.error == 'zebra_bib_index_mode_is_grs1' %]
280
                <tr>
280
                <tr>
281
                    <th scope="row"><b>Warning</b></th>
281
                    <th scope="row"><b>Warning</b></th>
282
                    <td>The &lt;zebra_bib_index_mode&gt; entry is missing in your configuration file.
282
                    <td>The &lt;zebra_bib_index_mode&gt; entry set to 'grs1', which is no longer supported.
283
                        It should be set to 'dom' or 'grs1' (deprecated).
284
                        It will default to 'dom'.
285
                    </td>
286
                </tr>
287
                [% ELSIF config_entry.error == 'zebra_bib_mode_seems_grs1' %]
288
                <tr>
289
                    <th scope="row"><b>Info</b></th>
290
                    <td>Your configuration file still seems to be set up for 'grs1'.</td>
291
                </tr>
292
                [% ELSIF config_entry.error == 'zebra_bib_mode_seems_dom' %]
293
                <tr>
294
                    <th scope="row"><b>Info</b></th>
295
                    <td>Your configuration file seems to be set up for 'dom'.</td>
296
                </tr>
297
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %]
298
                <tr>
299
                    <th scope="row"><b>Warning</b></th>
300
                    <td>The &lt;zebra_auth_index_mode&gt; entry is missing in your configuration file.
301
                        It should be set to 'dom' or 'grs1' (deprecated).
302
                        It will default to 'dom'.
303
                    </td>
304
                </tr>
305
                [% ELSIF config_entry.error == 'zebra_auth_mode_seems_grs1' %]
306
                <tr>
307
                    <th scope="row"><b>Info</b></th>
308
                    <td>Your configuration file still seems to be set up for 'grs1'.</td>
309
                </tr>
310
                [% ELSIF config_entry.error == 'zebra_auth_mode_seems_dom' %]
311
                <tr>
312
                    <th scope="row"><b>Info</b></th>
313
                    <td>Your configuration file seems to be set up for 'dom'.</td>
314
                </tr>
315
                [% ELSIF config_entry.error == 'zebra_bib_grs_warn' %]
316
                <tr>
317
                    <th scope="row"><b>Warning</b></th>
318
                    <td>The &lt;zebra_bib_index_mode&gt; entry is set to 'grs1'.
319
                        GRS-1 support is now deprecated and will be removed in future releases.
320
                        Please use DOM instead. To switch follow this page of wiki:
283
                        Please use DOM instead. To switch follow this page of wiki:
321
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
284
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
322
                    </td>
285
                    </td>
323
                </tr>
286
                </tr>
324
                [% ELSIF config_entry.error == 'zebra_bib_index_mode_mismatch_warn' %]
287
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_is_grs1' %]
325
                <tr>
288
                <tr>
326
                    <th scope="row"><b>Warning</b></th>
289
                    <th scope="row"><b>Warning</b></th>
327
                    <td>The &lt;zebra_bib_index_mode&gt; entry is set to 'dom', but your system still appears to be set up for 'grs1' indexing.</td>
290
                    <td>The &lt;zebra_auth_index_mode&gt; entry set to 'grs1', which is no longer supported.
328
                </tr>
329
                [% ELSIF config_entry.error == 'zebra_auth_grs_warn' %]
330
                <tr>
331
                    <th scope="row"><b>Warning</b></th>
332
                    <td>The &lt;zebra_auth_index_mode&gt; entry is set to 'grs1'.
333
                        GRS-1 support is now deprecated and will be removed in future releases.
334
                        Please use DOM instead. To switch follow this page of wiki:
291
                        Please use DOM instead. To switch follow this page of wiki:
335
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
292
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
336
                    </td>
293
                    </td>
337
                </tr>
294
                </tr>
338
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_mismatch_warn' %]
339
                <tr>
340
                    <th scope="row"><b>Warning</b></th>
341
                    <td>The &lt;zebra_auth_index_mode&gt; entry is set to 'dom', but your system still appears to be set up for 'grs1' indexing.</td>
342
                </tr>
343
                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
295
                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
344
                <tr>
296
                <tr>
345
                    <th scope="row"><b>Warning</b></th>
297
                    <th scope="row"><b>Warning</b></th>
Lines 354-366 Link Here
354
                        to legacy facet calculation.
306
                        to legacy facet calculation.
355
                    </td>
307
                    </td>
356
                </tr>
308
                </tr>
357
                [% ELSIF config_entry.error == 'use_zebra_facets_needs_dom' %]
358
                <tr>
359
                    <th scope="row"><b>Warning</b></th>
360
                    <td>You have set &lt;use_zebra_facets&gt; but the &lt;zebra_bib_index_mode&gt; is not set to 'dom'. Falling back
361
                        to legacy facet calculation.
362
                    </td>
363
                </tr>
364
                [% ELSIF config_entry.error == 'log4perl_entry_missing' %]
309
                [% ELSIF config_entry.error == 'log4perl_entry_missing' %]
365
                <tr>
310
                <tr>
366
                    <th scope="row"><b>Warning</b></th>
311
                    <th scope="row"><b>Warning</b></th>
(-)a/misc/koha-install-log (-2 lines)
Lines 60-67 INSTALL_BASE=__INSTALL_BASE__ Link Here
60
INSTALL_ZEBRA=__INSTALL_ZEBRA__
60
INSTALL_ZEBRA=__INSTALL_ZEBRA__
61
INSTALL_SRU=__INSTALL_SRU__
61
INSTALL_SRU=__INSTALL_SRU__
62
INSTALL_PAZPAR2=__INSTALL_PAZPAR2__
62
INSTALL_PAZPAR2=__INSTALL_PAZPAR2__
63
BIB_INDEX_MODE=__BIB_INDEX_MODE__
64
AUTH_INDEX_MODE=__AUTH_INDEX_MODE__
65
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
63
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
66
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
64
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
67
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__
65
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__
(-)a/misc/migration_tools/rebuild_zebra.pl (-4 / +1 lines)
Lines 169-176 my $biblioserverdir = C4::Context->zebraconfig('biblioserver')->{directory}; Link Here
169
my $authorityserverdir = C4::Context->zebraconfig('authorityserver')->{directory};
169
my $authorityserverdir = C4::Context->zebraconfig('authorityserver')->{directory};
170
170
171
my $kohadir = C4::Context->config('intranetdir');
171
my $kohadir = C4::Context->config('intranetdir');
172
my $bib_index_mode  = C4::Context->config('zebra_bib_index_mode')  // 'dom';
173
my $auth_index_mode = C4::Context->config('zebra_auth_index_mode') // 'dom';
174
172
175
my ($biblionumbertagfield,$biblionumbertagsubfield) = C4::Biblio::GetMarcFromKohaField("biblio.biblionumber","");
173
my ($biblionumbertagfield,$biblionumbertagsubfield) = C4::Biblio::GetMarcFromKohaField("biblio.biblionumber","");
176
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = C4::Biblio::GetMarcFromKohaField("biblioitems.biblioitemnumber","");
174
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = C4::Biblio::GetMarcFromKohaField("biblioitems.biblioitemnumber","");
Lines 281-288 if ($keep_export) { Link Here
281
        print "parameter";
279
        print "parameter";
282
    }
280
    }
283
    print "\n";
281
    print "\n";
284
    print "if you just want to rebuild zebra after changing the record.abs\n";
282
    print "if you just want to rebuild zebra after changing zebra config files\n";
285
    print "or another zebra config file\n";
286
} else {
283
} else {
287
    unless ($use_tempdir) {
284
    unless ($use_tempdir) {
288
        # if we're using a temporary directory
285
        # if we're using a temporary directory
(-)a/rewrite-config.PL (-6 / +4 lines)
Lines 131-140 $prefix = $ENV{'INSTALL_BASE'} || "/usr"; Link Here
131
  '__ZEBRA_TOKENIZER__' => 'chr',
131
  '__ZEBRA_TOKENIZER__' => 'chr',
132
  '__ZEBRA_TOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
132
  '__ZEBRA_TOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
133
  '__ZEBRA_PTOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
133
  '__ZEBRA_PTOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
134
  '__ZEBRA_AUTH_CFG__' => 'zebra-authorities.cfg',
134
  '__AUTH_RETRIEVAL_CFG__' => 'retrieval-info-auth-dom.xml',
135
  '__ZEBRA_BIB_CFG__' => 'zebra-biblios.cfg',
135
  '__BIB_RETRIEVAL_CFG__' => 'retrieval-info-bib-dom.xml',
136
  '__AUTH_RETRIEVAL_CFG__' => 'retrieval-info-auth-grs1.xml',
136
  '__ZEBRA_AUTH_CFG__' => 'zebra-authorities-dom.cfg',
137
  '__BIB_RETRIEVAL_CFG__' => 'retrieval-info-bib-grs1.xml',
137
  '__ZEBRA_BIB_CFG__' => 'zebra-biblios-dom.cfg',
138
  "__MERGE_SERVER_HOST__" => $myhost,
138
  "__MERGE_SERVER_HOST__" => $myhost,
139
  "__MERGE_SERVER_PORT__" => '11001',
139
  "__MERGE_SERVER_PORT__" => '11001',
140
  "__PAZPAR2_HOST__" => $myhost,
140
  "__PAZPAR2_HOST__" => $myhost,
Lines 145-152 $prefix = $ENV{'INSTALL_BASE'} || "/usr"; Link Here
145
  "__INSTALL_PAZPAR2__" => 'no',
145
  "__INSTALL_PAZPAR2__" => 'no',
146
  "__PAZPAR2_TOGGLE_XML_PRE__" => '<!--',
146
  "__PAZPAR2_TOGGLE_XML_PRE__" => '<!--',
147
  "__PAZPAR2_TOGGLE_XML_POST__" => '-->',
147
  "__PAZPAR2_TOGGLE_XML_POST__" => '-->',
148
  "__AUTH_INDEX_MODE__" => 'grs1',
149
  "__BIB_INDEX_MODE__" => 'grs1',
150
  "__RUN_DATABASE_TESTS__" => 'no',
148
  "__RUN_DATABASE_TESTS__" => 'no',
151
  "__PATH_TO_ZEBRA__" => "",
149
  "__PATH_TO_ZEBRA__" => "",
152
  "__USE_MEMCACHED__" => 'no',
150
  "__USE_MEMCACHED__" => 'no',
(-)a/t/db_dependent/Search.t (-107 / +47 lines)
Lines 27-33 require C4::Context; Link Here
27
# work around spurious wide character warnings
27
# work around spurious wide character warnings
28
use open ':std', ':encoding(utf8)';
28
use open ':std', ':encoding(utf8)';
29
29
30
use Test::More tests => 4;
30
use Test::More tests => 2;
31
use Test::MockModule;
31
use Test::MockModule;
32
use Test::Warn;
32
use Test::Warn;
33
33
Lines 45-68 our $child; Link Here
45
our $datadir;
45
our $datadir;
46
46
47
sub index_sample_records_and_launch_zebra {
47
sub index_sample_records_and_launch_zebra {
48
    my ($datadir, $indexing_mode, $marc_type) = @_;
48
    my ($datadir, $marc_type) = @_;
49
49
50
    my $sourcedir = dirname(__FILE__) . "/data";
50
    my $sourcedir = dirname(__FILE__) . "/data";
51
    unlink("$datadir/zebra.log");
51
    unlink("$datadir/zebra.log");
52
    if (-f "$sourcedir/${marc_type}/zebraexport/biblio/exported_records") {
52
    if (-f "$sourcedir/${marc_type}/zebraexport/biblio/exported_records") {
53
        my $zebra_bib_cfg = ($indexing_mode eq 'dom') ? 'zebra-biblios-dom.cfg' : 'zebra-biblios.cfg';
53
        my $zebra_bib_cfg = 'zebra-biblios-dom.cfg';
54
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g iso2709 -d biblios init");
54
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g iso2709 -d biblios init");
55
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g iso2709 -d biblios update $sourcedir/${marc_type}/zebraexport/biblio");
55
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g iso2709 -d biblios update $sourcedir/${marc_type}/zebraexport/biblio");
56
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g iso2709 -d biblios commit");
56
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g iso2709 -d biblios commit");
57
    }
57
    }
58
    # ... and add large bib records, if present
58
    # ... and add large bib records, if present
59
    if (-f "$sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}/exported_records.xml") {
59
    if (-f "$sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}/exported_records.xml") {
60
        my $zebra_bib_cfg = ($indexing_mode eq 'dom') ? 'zebra-biblios-dom.cfg' : 'zebra-biblios.cfg';
60
        my $zebra_bib_cfg = 'zebra-biblios-dom.cfg';
61
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g marcxml -d biblios update $sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}");
61
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g marcxml -d biblios update $sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}");
62
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g marcxml -d biblios commit");
62
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg  -v none,fatal -g marcxml -d biblios commit");
63
    }
63
    }
64
    if (-f "$sourcedir/${marc_type}/zebraexport/authority/exported_records") {
64
    if (-f "$sourcedir/${marc_type}/zebraexport/authority/exported_records") {
65
        my $zebra_auth_cfg = ($indexing_mode eq 'dom') ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg';
65
        my $zebra_auth_cfg = 'zebra-authorities-dom.cfg';
66
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg  -v none,fatal -g iso2709 -d authorities init");
66
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg  -v none,fatal -g iso2709 -d authorities init");
67
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg  -v none,fatal -g iso2709 -d authorities update $sourcedir/${marc_type}/zebraexport/authority");
67
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg  -v none,fatal -g iso2709 -d authorities update $sourcedir/${marc_type}/zebraexport/authority");
68
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg  -v none,fatal -g iso2709 -d authorities commit");
68
        system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg  -v none,fatal -g iso2709 -d authorities commit");
Lines 203-211 sub mock_GetMarcSubfieldStructure { Link Here
203
}
203
}
204
204
205
sub run_marc21_search_tests {
205
sub run_marc21_search_tests {
206
    my $indexing_mode = shift;
207
    $datadir = tempdir();
206
    $datadir = tempdir();
208
    system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21 $indexing_mode");
207
    system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21");
209
208
210
    Koha::Caches->get_instance('config')->flush_all;
209
    Koha::Caches->get_instance('config')->flush_all;
211
210
Lines 213-223 sub run_marc21_search_tests { Link Here
213
    my $context = new C4::Context("$datadir/etc/koha-conf.xml");
212
    my $context = new C4::Context("$datadir/etc/koha-conf.xml");
214
    $context->set_context();
213
    $context->set_context();
215
214
216
    is($context->config('zebra_bib_index_mode'),$indexing_mode,
217
        "zebra_bib_index_mode is properly set to '$indexing_mode' in the created koha-conf.xml file (BZ11499)");
218
    is($context->config('zebra_auth_index_mode'),$indexing_mode,
219
        "zebra_auth_index_mode is properly set to '$indexing_mode' in the created koha-conf.xml file (BZ11499)");
220
221
    use_ok('C4::Search');
215
    use_ok('C4::Search');
222
216
223
    # set search syspreferences to a known starting point
217
    # set search syspreferences to a known starting point
Lines 259-265 sub run_marc21_search_tests { Link Here
259
        'VM' => { 'imageurl' => 'bridge/dvd.gif', 'summary' => '', 'itemtype' => 'VM', 'description' => 'Visual Materials' },
253
        'VM' => { 'imageurl' => 'bridge/dvd.gif', 'summary' => '', 'itemtype' => 'VM', 'description' => 'Visual Materials' },
260
    );
254
    );
261
255
262
    index_sample_records_and_launch_zebra($datadir, $indexing_mode, 'marc21');
256
    index_sample_records_and_launch_zebra($datadir, 'marc21');
263
257
264
    my ($biblionumber, $title);
258
    my ($biblionumber, $title);
265
    my $record = MARC::Record->new;
259
    my $record = MARC::Record->new;
Lines 326-403 sub run_marc21_search_tests { Link Here
326
        getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
320
        getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
327
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records");
321
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records");
328
322
329
if ( $indexing_mode eq 'dom' ) {
323
( undef, $results_hashref, $facets_loop ) =
330
    ( undef, $results_hashref, $facets_loop ) =
324
    getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
331
        getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
325
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ &&
332
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ &&
326
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' &&
333
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' &&
327
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
334
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
328
    , "Simple relevance sorting in getRecords matches old behavior");
335
        , "Simple relevance sorting in getRecords matches old behavior");
329
336
330
( undef, $results_hashref, $facets_loop ) =
337
    ( undef, $results_hashref, $facets_loop ) =
331
    getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
338
        getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
332
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ &&
339
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ &&
333
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
340
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
334
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien'
341
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien'
335
    , "Simple ascending author sorting in getRecords matches old behavior");
342
        , "Simple ascending author sorting in getRecords matches old behavior");
336
343
337
( undef, $results_hashref, $facets_loop ) =
344
    ( undef, $results_hashref, $facets_loop ) =
338
    getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
345
        getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
339
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
346
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
340
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
347
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
341
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/
348
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/
342
    , "Simple descending author sorting in getRecords matches old behavior");
349
        , "Simple descending author sorting in getRecords matches old behavior");
343
350
344
( undef, $results_hashref, $facets_loop ) =
351
    ( undef, $results_hashref, $facets_loop ) =
345
    getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
352
        getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
346
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' &&
353
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' &&
347
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ &&
354
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ &&
348
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
355
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
349
    , "Simple ascending publication date sorting in getRecords matches old behavior");
356
        , "Simple ascending publication date sorting in getRecords matches old behavior");
350
357
351
( undef, $results_hashref, $facets_loop ) =
358
    ( undef, $results_hashref, $facets_loop ) =
352
    getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
359
        getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
353
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ &&
360
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ &&
354
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
361
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
355
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies'
362
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies'
356
    , "Simple descending publication date sorting in getRecords matches old behavior");
363
        , "Simple descending publication date sorting in getRecords matches old behavior");
364
365
} elsif ( $indexing_mode eq 'grs1' ){
366
    ( undef, $results_hashref, $facets_loop ) =
367
        getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
368
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ &&
369
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies' &&
370
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/
371
        , "Simple relevance sorting in getRecords matches old behavior");
372
373
    ( undef, $results_hashref, $facets_loop ) =
374
        getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
375
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/la enfermedad laboral\^ies$/ &&
376
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[6])->title_proper() =~ m/^Indicadores de resultados identificados/ &&
377
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'World health statistics 2009^ien'
378
        , "Simple ascending author sorting in getRecords matches old behavior");
379
380
    ( undef, $results_hashref, $facets_loop ) =
381
        getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
382
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'World health statistics 2009^ien' &&
383
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[12])->title_proper() =~ m/^Indicadores de resultados identificados/ &&
384
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/la enfermedad laboral\^ies$/
385
        , "Simple descending author sorting in getRecords matches old behavior");
386
387
    ( undef, $results_hashref, $facets_loop ) =
388
        getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
389
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'Manual de higiene industrial^ies' &&
390
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ &&
391
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/
392
        , "Simple ascending publication date sorting in getRecords matches old behavior");
393
394
    ( undef, $results_hashref, $facets_loop ) =
395
        getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
396
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Estado de salud/ &&
397
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' &&
398
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies'
399
        , "Simple descending publication date sorting in getRecords matches old behavior");
400
}
401
357
402
    ( undef, $results_hashref, $facets_loop ) =
358
    ( undef, $results_hashref, $facets_loop ) =
403
        getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1);
359
        getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1);
Lines 544-555 if ( $indexing_mode eq 'dom' ) { Link Here
544
500
545
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
501
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
546
    is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results");
502
    is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results");
547
    if ($indexing_mode eq 'grs1') {
503
    is(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first");
548
        is(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first");
549
    } else {
550
        local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS";
551
        is(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper(), 'Salud y seguridad de los trabajadores del sector salud: manual para gerentes y administradores^ies', "Weighted query returns best match first");
552
    }
553
504
554
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = 0;
505
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = 0;
555
    $QueryAutoTruncate = 1;
506
    $QueryAutoTruncate = 1;
Lines 872-880 if ( $indexing_mode eq 'dom' ) { Link Here
872
}
823
}
873
824
874
sub run_unimarc_search_tests {
825
sub run_unimarc_search_tests {
875
    my $indexing_mode = shift;
876
    $datadir = tempdir();
826
    $datadir = tempdir();
877
    system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc $indexing_mode");
827
    system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc");
878
828
879
    Koha::Caches->get_instance('config')->flush_all;
829
    Koha::Caches->get_instance('config')->flush_all;
880
830
Lines 892-898 sub run_unimarc_search_tests { Link Here
892
    $UseQueryParser = 0;
842
    $UseQueryParser = 0;
893
    $marcflavour = 'UNIMARC';
843
    $marcflavour = 'UNIMARC';
894
844
895
    index_sample_records_and_launch_zebra($datadir, $indexing_mode, 'unimarc');
845
    index_sample_records_and_launch_zebra($datadir, 'unimarc');
896
846
897
    my ( $error, $marcresults, $total_hits ) = SimpleSearch("ti=Järnvägarnas efterfrågan och den svenska industrin", 0, 10);
847
    my ( $error, $marcresults, $total_hits ) = SimpleSearch("ti=Järnvägarnas efterfrågan och den svenska industrin", 0, 10);
898
    is($total_hits, 1, 'UNIMARC title search');
848
    is($total_hits, 1, 'UNIMARC title search');
Lines 965-988 sub run_unimarc_search_tests { Link Here
965
    cleanup();
915
    cleanup();
966
}
916
}
967
917
968
subtest 'MARC21 + GRS-1' => sub {
969
    plan tests => 109;
970
    run_marc21_search_tests('grs1');
971
};
972
973
subtest 'MARC21 + DOM' => sub {
918
subtest 'MARC21 + DOM' => sub {
974
    plan tests => 109;
919
    plan tests => 107;
975
    run_marc21_search_tests('dom');
920
    run_marc21_search_tests();
976
};
977
978
subtest 'UNIMARC + GRS-1' => sub {
979
    plan tests => 14;
980
    run_unimarc_search_tests('grs1');
981
};
921
};
982
922
983
subtest 'UNIMARC + DOM' => sub {
923
subtest 'UNIMARC + DOM' => sub {
984
    plan tests => 14;
924
    plan tests => 14;
985
    run_unimarc_search_tests('dom');
925
    run_unimarc_search_tests();
986
};
926
};
987
927
988
# Make sure that following tests are not using our config settings
928
# Make sure that following tests are not using our config settings
(-)a/t/db_dependent/XISBN.t (-4 / +1 lines)
Lines 129-138 sub Mock_SimpleSearch { Link Here
129
    }
129
    }
130
    $record->append_fields($biblionumber_field);
130
    $record->append_fields($biblionumber_field);
131
131
132
    my $indexing_mode = C4::Context->config('zebra_bib_index_mode') // 'dom';
132
    push @results, $record->as_xml();
133
    push @results, ( $indexing_mode eq 'dom' )
134
                    ? $record->as_xml()
135
                    : $record->as_usmarc() ;
136
133
137
    return ( undef, \@results, 1 );
134
    return ( undef, \@results, 1 );
138
}
135
}
(-)a/t/db_dependent/zebra_config.pl (-15 / +4 lines)
Lines 15-35 my $destination = $ARGV[0]; Link Here
15
my $marc_type = $ARGV[1] || 'marc21';
15
my $marc_type = $ARGV[1] || 'marc21';
16
my $indexing_mode = $ARGV[2] || 'dom';
16
my $indexing_mode = $ARGV[2] || 'dom';
17
17
18
$ENV{__BIB_INDEX_MODE__} = $indexing_mode;
19
$ENV{__AUTH_INDEX_MODE__} = $indexing_mode;
20
21
$ENV{__ZEBRA_MARC_FORMAT__} = $marc_type;
18
$ENV{__ZEBRA_MARC_FORMAT__} = $marc_type;
22
if ($indexing_mode eq 'dom') {
19
$ENV{__ZEBRA_BIB_CFG__} = 'zebra-biblios-dom.cfg';
23
    $ENV{__ZEBRA_BIB_CFG__} = 'zebra-biblios-dom.cfg';
20
$ENV{__BIB_RETRIEVAL_CFG__} = 'retrieval-info-bib-dom.xml';
24
    $ENV{__BIB_RETRIEVAL_CFG__} = 'retrieval-info-bib-dom.xml';
21
$ENV{__ZEBRA_AUTH_CFG__} = 'zebra-authorities-dom.cfg';
25
    $ENV{__ZEBRA_AUTH_CFG__} = 'zebra-authorities-dom.cfg';
22
$ENV{__AUTH_RETRIEVAL_CFG__} = 'retrieval-info-auth-dom.xml';
26
    $ENV{__AUTH_RETRIEVAL_CFG__} = 'retrieval-info-auth-dom.xml';
27
} else {
28
    $ENV{__ZEBRA_BIB_CFG__} = 'zebra-biblios.cfg';
29
    $ENV{__BIB_RETRIEVAL_CFG__} = 'retrieval-info-bib-grs1.xml';
30
    $ENV{__ZEBRA_AUTH_CFG__} = 'zebra-authorities.cfg';
31
    $ENV{__AUTH_RETRIEVAL_CFG__} = 'retrieval-info-auth-grs1.xml';
32
}
33
23
34
make_path("$destination/var/lock/zebradb");
24
make_path("$destination/var/lock/zebradb");
35
make_path("$destination/var/lock/zebradb/biblios");
25
make_path("$destination/var/lock/zebradb/biblios");
36
- 

Return to bug 14302