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

(-)a/C4/Context.pm (-10 / +2 lines)
Lines 619-634 sub _new_Zconn { Link Here
619
        $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom';
619
        $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom';
620
    }
620
    }
621
621
622
    if ( $index_mode eq 'grs1' ) {
622
    $syntax = 'xml';
623
        $elementSetName = 'F';
623
    $elementSetName = 'marcxml';
624
        $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' )
625
                ? 'unimarc'
626
                : 'usmarc';
627
628
    } else { # $index_mode eq 'dom'
629
        $syntax = 'xml';
630
        $elementSetName = 'marcxml';
631
    }
632
624
633
    my $host = $context->{'listen'}->{$server}->{'content'};
625
    my $host = $context->{'listen'}->{$server}->{'content'};
634
    my $user = $context->{"serverinfo"}->{$server}->{"user"};
626
    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 470-477 my %config_defaults = ( Link Here
470
  'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
468
  'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem',
471
  'INSTALL_SRU'       => 'yes',
469
  'INSTALL_SRU'       => 'yes',
472
  'INSTALL_PAZPAR2'   => 'no',
470
  'INSTALL_PAZPAR2'   => 'no',
473
  'AUTH_INDEX_MODE'   => 'dom',
474
  'BIB_INDEX_MODE'    => 'dom',
475
  'ZEBRA_MARC_FORMAT' => 'marc21',
471
  'ZEBRA_MARC_FORMAT' => 'marc21',
476
  'ZEBRA_LANGUAGE'    => 'en',
472
  'ZEBRA_LANGUAGE'    => 'en',
477
  'ZEBRA_TOKENIZER'   => 'chr',
473
  'ZEBRA_TOKENIZER'   => 'chr',
Lines 517-524 my %valid_config_values = ( Link Here
517
  'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
513
  'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
518
  'DB_USE_TLS' => {'yes', 'no'},
514
  'DB_USE_TLS' => {'yes', 'no'},
519
  'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
515
  'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
520
  'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 },
521
  'BIB_INDEX_MODE'  => { 'grs1' => 1, 'dom' => 1 },
522
  'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
516
  'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
523
  '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
517
  '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
524
  'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 },
518
  'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 },
Lines 543-550 my $cli_zebra_pass = ""; Link Here
543
my $cli_zebra_sru_host = "";
537
my $cli_zebra_sru_host = "";
544
my $cli_zebra_sru_bib_port = "";
538
my $cli_zebra_sru_bib_port = "";
545
my $cli_zebra_sru_auth_port = "";
539
my $cli_zebra_sru_auth_port = "";
546
my $cli_koha_auth_index_mode = "";
547
my $cli_koha_bib_index_mode = "";
548
my $cli_koha_user = "";
540
my $cli_koha_user = "";
549
my $cli_koha_group = "";
541
my $cli_koha_group = "";
550
my $cli_koha_install_sru = "";
542
my $cli_koha_install_sru = "";
Lines 572-579 my $results = GetOptions( Link Here
572
    "zebra_sru_host=s"             => \$cli_zebra_sru_host,
564
    "zebra_sru_host=s"             => \$cli_zebra_sru_host,
573
    "zebra_sru_biblios_port=s"     => \$cli_zebra_sru_bib_port,
565
    "zebra_sru_biblios_port=s"     => \$cli_zebra_sru_bib_port,
574
    "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port,
566
    "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port,
575
    "auth_index_mode=s"            => \$cli_koha_auth_index_mode,
576
    "bib_index_mode=s"             => \$cli_koha_bib_index_mode,
577
    "koha_user=s"                  => \$cli_koha_user,
567
    "koha_user=s"                  => \$cli_koha_user,
578
    "koha_group=s"                 => \$cli_koha_group,
568
    "koha_group=s"                 => \$cli_koha_group,
579
    "install_sru=s"                => \$cli_koha_install_sru,
569
    "install_sru=s"                => \$cli_koha_install_sru,
Lines 615-629 my $pl_files = { Link Here
615
605
616
push @{ $pl_files->{'rewrite-config.PL'} }, (
606
push @{ $pl_files->{'rewrite-config.PL'} }, (
617
    'blib/ZEBRA_CONF_DIR/etc/passwd',
607
    'blib/ZEBRA_CONF_DIR/etc/passwd',
618
    'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg',
619
    'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
608
    'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
620
    'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg',
621
    'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg',
609
    'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg',
622
    'blib/ZEBRA_CONF_DIR/explain-authorities.xml',
610
    'blib/ZEBRA_CONF_DIR/explain-authorities.xml',
623
    'blib/ZEBRA_CONF_DIR/explain-biblios.xml',
611
    'blib/ZEBRA_CONF_DIR/explain-biblios.xml',
624
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml',
625
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
612
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
626
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-grs1.xml',
627
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml',
613
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml',
628
);
614
);
629
push @{ $pl_files->{'rewrite-config.PL'} }, (
615
push @{ $pl_files->{'rewrite-config.PL'} }, (
Lines 637-655 if ($config{'INSTALL_PAZPAR2'} eq 'yes') { Link Here
637
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
623
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
638
    );
624
    );
639
}
625
}
640
$config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom'
626
$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg';
641
                              ? 'zebra-authorities-dom.cfg'
627
$config{'ZEBRA_BIB_CFG'}  = 'zebra-biblios-dom.cfg';
642
                              : 'zebra-authorities.cfg';
628
$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml';
643
$config{'ZEBRA_BIB_CFG'}  = $config{'BIB_INDEX_MODE'} eq 'dom'
629
$config{'BIB_RETRIEVAL_CFG'}  = 'retrieval-info-bib-dom.xml';
644
                              ? 'zebra-biblios-dom.cfg'
645
                              : 'zebra-biblios.cfg';
646
$config{'AUTH_RETRIEVAL_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom'
647
                                  ? 'retrieval-info-auth-dom.xml'
648
                                  : 'retrieval-info-auth-grs1.xml';
649
$config{'BIB_RETRIEVAL_CFG'}  = $config{'BIB_INDEX_MODE'} eq 'dom'
650
                                  ? 'retrieval-info-bib-dom.xml'
651
                                  : 'retrieval-info-bib-grs1.xml';
652
653
630
654
if ($config{'INSTALL_MODE'} ne "dev") {
631
if ($config{'INSTALL_MODE'} ne "dev") {
655
    push @{ $pl_files->{'rewrite-config.PL'} }, (
632
    push @{ $pl_files->{'rewrite-config.PL'} }, (
Lines 861-868 sub get_cli_values { Link Here
861
        ZEBRA_SRU_HOST             => $cli_zebra_sru_host,
838
        ZEBRA_SRU_HOST             => $cli_zebra_sru_host,
862
        ZEBRA_SRU_BIBLIOS_PORT     => $cli_zebra_sru_bib_port,
839
        ZEBRA_SRU_BIBLIOS_PORT     => $cli_zebra_sru_bib_port,
863
        ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port,
840
        ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port,
864
        AUTH_INDEX_MODE            => $cli_koha_auth_index_mode,
865
        BIB_INDEX_MODE             => $cli_koha_bib_index_mode,
866
        KOHA_USER                  => $cli_koha_user,
841
        KOHA_USER                  => $cli_koha_user,
867
        KOHA_GROUP                 => $cli_koha_group,
842
        KOHA_GROUP                 => $cli_koha_group,
868
        INSTALL_SRU                => $cli_koha_install_sru,
843
        INSTALL_SRU                => $cli_koha_install_sru,
Lines 1121-1153 Primary language for Zebra indexing); Link Here
1121
    $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
1096
    $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
1122
1097
1123
    $msg = q(
1098
    $msg = q(
1124
Koha can use one of  two different indexing modes
1125
for the MARC bibliographic records:
1126
1127
dom  - uses the DOM XML filter; offers improved
1128
       functionality.
1129
grs1 - [DEPRECATED] uses the Zebra GRS-1 filter,
1130
       available for legacy support
1131
1132
Bibliographic indexing mode);
1133
    $msg .= _add_valid_values_disp('BIB_INDEX_MODE', $valid_values);
1134
    $config{'BIB_INDEX_MODE'} = _get_value('BIB_INDEX_MODE', $msg, $defaults->{'BIB_INDEX_MODE'}, $valid_values, $install_log_values);
1135
1136
1137
    $msg = q(
1138
Koha can use one of  two different indexing modes
1139
for the MARC authorities records:
1140
1141
dom  - uses the DOM XML filter; offers improved
1142
       functionality.
1143
grs1 - [DEPRECATED] uses the Zebra GRS-1 filter,
1144
       available for legacy support
1145
1146
Authorities indexing mode);
1147
    $msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values);
1148
    $config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values);
1149
1150
    $msg = q(
1151
Zebra has two methods to perform records tokenization
1099
Zebra has two methods to perform records tokenization
1152
and characters normalization: CHR and ICU. ICU is
1100
and characters normalization: CHR and ICU. ICU is
1153
recommended for catalogs containing non-Latin
1101
recommended for catalogs containing non-Latin
(-)a/about.pl (-64 / +8 lines)
Lines 176-233 my @xml_config_warnings; Link Here
176
176
177
my $context = new C4::Context;
177
my $context = new C4::Context;
178
178
179
if ( ! defined C4::Context->config('zebra_bib_index_mode') ) {
179
if (    C4::Context->config('zebra_bib_index_mode')
180
    push @xml_config_warnings, {
180
    and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
181
        error => 'zebra_bib_index_mode_warn'
181
{
182
    };
182
    push @xml_config_warnings, { error => 'zebra_bib_index_mode_is_grs1' };
183
    if ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) {
184
        push @xml_config_warnings, {
185
            error => 'zebra_bib_mode_seems_grs1'
186
        };
187
    }
188
    else {
189
        push @xml_config_warnings, {
190
            error => 'zebra_bib_mode_seems_dom'
191
        };
192
    }
193
} else {
194
    push @xml_config_warnings, { error => 'zebra_bib_grs_warn' }
195
        if C4::Context->config('zebra_bib_index_mode') eq 'grs1';
196
}
197
198
if ( (C4::Context->config('zebra_bib_index_mode') eq 'dom') &&
199
     ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) ) {
200
201
    push @xml_config_warnings, {
202
        error => 'zebra_bib_index_mode_mismatch_warn'
203
    };
204
}
205
206
if ( (C4::Context->config('zebra_bib_index_mode') eq 'grs1') &&
207
     ($context->{'server'}->{'biblioserver'}->{'config'} =~ /zebra-biblios-dom.cfg/) ) {
208
209
    push @xml_config_warnings, {
210
        error => 'zebra_bib_index_mode_mismatch_warn'
211
    };
212
}
183
}
213
184
214
if ( ! defined C4::Context->config('zebra_auth_index_mode') ) {
185
if (    C4::Context->config('zebra_auth_index_mode')
215
    push @xml_config_warnings, {
186
    and C4::Context->config('zebra_auth_index_mode') eq 'grs1' )
216
        error => 'zebra_auth_index_mode_warn'
187
{
217
    };
188
    push @xml_config_warnings, { error => 'zebra_auth_index_mode_is_grs1' };
218
    if ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) {
219
        push @xml_config_warnings, {
220
            error => 'zebra_auth_mode_seems_grs1'
221
        };
222
    }
223
    else {
224
        push @xml_config_warnings, {
225
            error => 'zebra_auth_mode_seems_dom'
226
        };
227
    }
228
} else {
229
    push @xml_config_warnings, { error => 'zebra_auth_grs_warn' }
230
        if C4::Context->config('zebra_auth_index_mode') eq 'grs1';
231
}
189
}
232
190
233
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
191
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
Lines 236-247 if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'ser Link Here
236
    };
194
    };
237
}
195
}
238
196
239
if ( (C4::Context->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'authorityserver'}->{'config'} =~ /zebra-authorities-dom.cfg/) ) {
240
    push @xml_config_warnings, {
241
        error => 'zebra_auth_index_mode_mismatch_warn'
242
    };
243
}
244
245
if ( ! defined C4::Context->config('log4perl_conf') ) {
197
if ( ! defined C4::Context->config('log4perl_conf') ) {
246
    push @xml_config_warnings, {
198
    push @xml_config_warnings, {
247
        error => 'log4perl_entry_missing'
199
        error => 'log4perl_entry_missing'
Lines 301-314 if ( C4::Context->preference( 'UseQueryParser' ) ) { Link Here
301
# Test Zebra facets configuration
253
# Test Zebra facets configuration
302
if ( !defined C4::Context->config('use_zebra_facets') ) {
254
if ( !defined C4::Context->config('use_zebra_facets') ) {
303
    push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
255
    push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
304
} else {
305
    if ( C4::Context->config('use_zebra_facets') &&
306
         C4::Context->config('zebra_bib_index_mode') ) {
307
        # use_zebra_facets works with DOM
308
        push @xml_config_warnings, {
309
            error => 'use_zebra_facets_needs_dom'
310
        } if C4::Context->config('zebra_bib_index_mode') ne 'dom' ;
311
    }
312
}
256
}
313
257
314
# ILL module checks
258
# 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 (-60 / +10 lines)
Lines 102-109 generate_config_file() { Link Here
102
        -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \
102
        -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \
103
        -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \
103
        -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \
104
        -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \
104
        -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \
105
        -e "s/__BIBLIOS_INDEXING_MODE__/$BIBLIOS_INDEXING_MODE/g" \
106
        -e "s/__AUTHORITIES_INDEXING_MODE__/$AUTHORITIES_INDEXING_MODE/g" \
107
        -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
105
        -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
108
        -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
106
        -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
109
        -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
107
        -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
Lines 228-298 EOM Link Here
228
226
229
set_biblios_indexing_mode()
227
set_biblios_indexing_mode()
230
{
228
{
231
    local indexing_mode=$1
229
    local marc_format=$1
232
    local marc_format=$2
233
230
234
    case $indexing_mode in
231
    START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
235
        "dom")
236
            START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
237
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
232
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
238
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
233
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
239
     <xi:fallback>\n
234
     <xi:fallback>\n
240
      <retrievalinfo>
235
      <retrievalinfo>
241
EOF`
236
EOF`
242
237
243
            END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
238
    END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
244
      <\/retrievalinfo>\n
239
      <\/retrievalinfo>\n
245
     <\/xi:fallback>\n
240
     <\/xi:fallback>\n
246
    <\/xi:include>
241
    <\/xi:include>
247
EOF`
242
EOF`
248
            BIBLIOS_INDEXING_MODE="dom"
243
    ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
249
            ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
250
            ;;
251
        "grs1")
252
            START_BIBLIOS_RETRIEVAL_INFO="    <retrievalinfo>"
253
            END_BIBLIOS_RETRIEVAL_INFO="    <\/retrievalinfo>"
254
            BIBLIOS_INDEXING_MODE="grs1"
255
            ZEBRA_BIBLIOS_CFG="zebra-biblios.cfg"
256
            ;;
257
        *)
258
            die "Error: '$indexing_mode' is not a valid indexing mode for bibliographic records."
259
            ;;
260
    esac
261
}
244
}
262
245
263
246
264
set_authorities_indexing_mode()
247
set_authorities_indexing_mode()
265
{
248
{
266
    local indexing_mode=$1
249
    local marc_format=$1
267
    local marc_format=$2
268
250
269
    case $indexing_mode in
251
    START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
270
        "dom")
271
            START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
272
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
252
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
273
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
253
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
274
     <xi:fallback>\n
254
     <xi:fallback>\n
275
      <retrievalinfo>
255
      <retrievalinfo>
276
EOF`
256
EOF`
277
257
278
            END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
258
    END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
279
      <\/retrievalinfo>\n
259
      <\/retrievalinfo>\n
280
     <\/xi:fallback>\n
260
     <\/xi:fallback>\n
281
    <\/xi:include>\n
261
    <\/xi:include>\n
282
EOF`
262
EOF`
283
            AUTHORITIES_INDEXING_MODE="dom"
263
    ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
284
            ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
285
            ;;
286
        "grs1")
287
            START_AUTHORITIES_RETRIEVAL_INFO="    <retrievalinfo>"
288
            END_AUTHORITIES_RETRIEVAL_INFO="    <\/retrievalinfo>"
289
            AUTHORITIES_INDEXING_MODE="grs1"
290
            ZEBRA_AUTHORITIES_CFG="zebra-authorities.cfg"
291
            ;;
292
        *)
293
            die "Error: '$indexing_mode' is not a valid indexing mode for authority records."
294
            ;;
295
    esac
296
}
264
}
297
265
298
266
Lines 446-455 DEFAULT_SRU_SERVER_PORT="7090" Link Here
446
START_SRU_PUBLICSERVER="<!--"
414
START_SRU_PUBLICSERVER="<!--"
447
END_SRU_PUBLICSERVER="-->"
415
END_SRU_PUBLICSERVER="-->"
448
416
449
# Indexing mode variables (default is DOM)
450
BIBLIOS_INDEXING_MODE="dom"
451
AUTHORITIES_INDEXING_MODE="dom"
452
453
START_BIBLIOS_RETRIEVAL_INFO=""
417
START_BIBLIOS_RETRIEVAL_INFO=""
454
END_BIBLIOS_RETRIEVAL_INFO=""
418
END_BIBLIOS_RETRIEVAL_INFO=""
455
START_AUTHORITIES_RETRIEVAL_INFO=""
419
START_AUTHORITIES_RETRIEVAL_INFO=""
Lines 475-482 CLO_ZEBRA_MARC_FORMAT="" Link Here
475
CLO_ZEBRA_LANGUAGE=""
439
CLO_ZEBRA_LANGUAGE=""
476
CLO_DEFAULTSQL=""
440
CLO_DEFAULTSQL=""
477
CLO_ADMINUSER=""
441
CLO_ADMINUSER=""
478
CLO_BIBLIOS_INDEXING_MODE=""
479
CLO_AUTHORITIES_INDEXING_MODE=""
480
CLO_MEMCACHED_SERVERS=""
442
CLO_MEMCACHED_SERVERS=""
481
CLO_MEMCACHED_PREFIX=""
443
CLO_MEMCACHED_PREFIX=""
482
CLO_UPLOAD_PATH=""
444
CLO_UPLOAD_PATH=""
Lines 503-512 while true ; do Link Here
503
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
465
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
504
        -l|--zebralang)
466
        -l|--zebralang)
505
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
467
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
506
        --auth-idx)
507
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
508
        --biblio-idx)
509
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
510
        -d|--defaultsql)
468
        -d|--defaultsql)
511
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
469
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
512
        -f|--configfile)
470
        -f|--configfile)
Lines 583-599 if [ "$CLO_BIBLIOS_INDEXING_MODE" != "" ]; then Link Here
583
    BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE
541
    BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE
584
fi
542
fi
585
543
586
set_biblios_indexing_mode $BIBLIOS_INDEXING_MODE $ZEBRA_MARC_FORMAT
544
set_biblios_indexing_mode $ZEBRA_MARC_FORMAT
587
545
588
if [ "$ENABLE_SRU" != "no" ]; then
546
if [ "$ENABLE_SRU" != "no" ]; then
589
    enable_sru_server
547
    enable_sru_server
590
fi
548
fi
591
549
592
if [ "$CLO_AUTHORITIES_INDEXING_MODE" !=  "" ]; then
550
set_authorities_indexing_mode $ZEBRA_MARC_FORMAT
593
    AUTHORITIES_INDEXING_MODE=$CLO_AUTHORITIES_INDEXING_MODE
594
fi
595
596
set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT
597
551
598
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
552
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
599
553
Lines 754-765 eof Link Here
754
        "/etc/koha/sites/$name/log4perl.conf"
708
        "/etc/koha/sites/$name/log4perl.conf"
755
709
756
    # Generate and install Zebra config files.
710
    # Generate and install Zebra config files.
757
    generate_config_file zebra-biblios-site.cfg.in \
758
        "/etc/koha/sites/$name/zebra-biblios.cfg"
759
    generate_config_file zebra-biblios-dom-site.cfg.in \
711
    generate_config_file zebra-biblios-dom-site.cfg.in \
760
        "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
712
        "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
761
    generate_config_file zebra-authorities-site.cfg.in \
762
        "/etc/koha/sites/$name/zebra-authorities.cfg"
763
    generate_config_file zebra-authorities-dom-site.cfg.in \
713
    generate_config_file zebra-authorities-dom-site.cfg.in \
764
        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
714
        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
765
    generate_config_file zebra.passwd.in \
715
    generate_config_file zebra.passwd.in \
(-)a/debian/templates/koha-conf-site.xml.in (-2 lines)
Lines 279-286 __END_SRU_PUBLICSERVER__ Link Here
279
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
279
 <install_log>/usr/share/koha/misc/koha-install-log</install_log>
280
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
280
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
281
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
281
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
282
 <zebra_bib_index_mode>__BIBLIOS_INDEXING_MODE__</zebra_bib_index_mode>
283
 <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
284
 <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
282
 <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
285
 <use_zebra_facets>1</use_zebra_facets>
283
 <use_zebra_facets>1</use_zebra_facets>
286
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
284
 <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 115-122 __PAZPAR2_TOGGLE_XML_POST__ Link Here
115
 <install_log>__MISC_DIR__/koha-install-log</install_log>
115
 <install_log>__MISC_DIR__/koha-install-log</install_log>
116
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
116
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
117
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
117
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
118
 <zebra_bib_index_mode>__BIB_INDEX_MODE__</zebra_bib_index_mode>
119
 <zebra_auth_index_mode>__AUTH_INDEX_MODE__</zebra_auth_index_mode>
120
 <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
118
 <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
121
 <use_zebra_facets>1</use_zebra_facets>
119
 <use_zebra_facets>1</use_zebra_facets>
122
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
120
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-59 / +4 lines)
Lines 307-376 Link Here
307
            <table>
307
            <table>
308
                <caption>XML configuration file</caption>
308
                <caption>XML configuration file</caption>
309
            [% FOREACH config_entry IN xml_config_warnings %]
309
            [% FOREACH config_entry IN xml_config_warnings %]
310
                [% IF config_entry.error == 'zebra_bib_index_mode_warn' %]
310
                [% IF config_entry.error == 'zebra_bib_index_mode_is_grs1' %]
311
                <tr>
311
                <tr>
312
                    <th scope="row"><b>Warning</b></th>
312
                    <th scope="row"><b>Warning</b></th>
313
                    <td>The &lt;zebra_bib_index_mode&gt; entry is missing in your configuration file.
313
                    <td>The &lt;zebra_bib_index_mode&gt; entry set to 'grs1', which is no longer supported.
314
                        It should be set to 'dom' or 'grs1' (deprecated).
315
                        It will default to 'dom'.
316
                    </td>
317
                </tr>
318
                [% ELSIF config_entry.error == 'zebra_bib_mode_seems_grs1' %]
319
                <tr>
320
                    <th scope="row"><b>Info</b></th>
321
                    <td>Your configuration file still seems to be set up for 'grs1'.</td>
322
                </tr>
323
                [% ELSIF config_entry.error == 'zebra_bib_mode_seems_dom' %]
324
                <tr>
325
                    <th scope="row"><b>Info</b></th>
326
                    <td>Your configuration file seems to be set up for 'dom'.</td>
327
                </tr>
328
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %]
329
                <tr>
330
                    <th scope="row"><b>Warning</b></th>
331
                    <td>The &lt;zebra_auth_index_mode&gt; entry is missing in your configuration file.
332
                        It should be set to 'dom' or 'grs1' (deprecated).
333
                        It will default to 'dom'.
334
                    </td>
335
                </tr>
336
                [% ELSIF config_entry.error == 'zebra_auth_mode_seems_grs1' %]
337
                <tr>
338
                    <th scope="row"><b>Info</b></th>
339
                    <td>Your configuration file still seems to be set up for 'grs1'.</td>
340
                </tr>
341
                [% ELSIF config_entry.error == 'zebra_auth_mode_seems_dom' %]
342
                <tr>
343
                    <th scope="row"><b>Info</b></th>
344
                    <td>Your configuration file seems to be set up for 'dom'.</td>
345
                </tr>
346
                [% ELSIF config_entry.error == 'zebra_bib_grs_warn' %]
347
                <tr>
348
                    <th scope="row"><b>Warning</b></th>
349
                    <td>The &lt;zebra_bib_index_mode&gt; entry is set to 'grs1'.
350
                        GRS-1 support is now deprecated and will be removed in future releases.
351
                        Please use DOM instead. To switch follow this page of wiki:
314
                        Please use DOM instead. To switch follow this page of wiki:
352
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
315
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
353
                    </td>
316
                    </td>
354
                </tr>
317
                </tr>
355
                [% ELSIF config_entry.error == 'zebra_bib_index_mode_mismatch_warn' %]
318
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_is_grs1' %]
356
                <tr>
319
                <tr>
357
                    <th scope="row"><b>Warning</b></th>
320
                    <th scope="row"><b>Warning</b></th>
358
                    <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>
321
                    <td>The &lt;zebra_auth_index_mode&gt; entry set to 'grs1', which is no longer supported.
359
                </tr>
360
                [% ELSIF config_entry.error == 'zebra_auth_grs_warn' %]
361
                <tr>
362
                    <th scope="row"><b>Warning</b></th>
363
                    <td>The &lt;zebra_auth_index_mode&gt; entry is set to 'grs1'.
364
                        GRS-1 support is now deprecated and will be removed in future releases.
365
                        Please use DOM instead. To switch follow this page of wiki:
322
                        Please use DOM instead. To switch follow this page of wiki:
366
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
323
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
367
                    </td>
324
                    </td>
368
                </tr>
325
                </tr>
369
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_mismatch_warn' %]
370
                <tr>
371
                    <th scope="row"><b>Warning</b></th>
372
                    <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>
373
                </tr>
374
                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
326
                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
375
                <tr>
327
                <tr>
376
                    <th scope="row"><b>Warning</b></th>
328
                    <th scope="row"><b>Warning</b></th>
Lines 385-397 Link Here
385
                        to legacy facet calculation.
337
                        to legacy facet calculation.
386
                    </td>
338
                    </td>
387
                </tr>
339
                </tr>
388
                [% ELSIF config_entry.error == 'use_zebra_facets_needs_dom' %]
389
                <tr>
390
                    <th scope="row"><b>Warning</b></th>
391
                    <td>You have set &lt;use_zebra_facets&gt; but the &lt;zebra_bib_index_mode&gt; is not set to 'dom'. Falling back
392
                        to legacy facet calculation.
393
                    </td>
394
                </tr>
395
                [% ELSIF config_entry.error == 'log4perl_entry_missing' %]
340
                [% ELSIF config_entry.error == 'log4perl_entry_missing' %]
396
                <tr>
341
                <tr>
397
                    <th scope="row"><b>Warning</b></th>
342
                    <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__" => 'yes',
150
  "__USE_MEMCACHED__" => 'yes',
(-)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 881-889 if ( $indexing_mode eq 'dom' ) { Link Here
881
}
832
}
882
833
883
sub run_unimarc_search_tests {
834
sub run_unimarc_search_tests {
884
    my $indexing_mode = shift;
885
    $datadir = tempdir();
835
    $datadir = tempdir();
886
    system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc $indexing_mode");
836
    system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc");
887
837
888
    Koha::Caches->get_instance('config')->flush_all;
838
    Koha::Caches->get_instance('config')->flush_all;
889
839
Lines 901-907 sub run_unimarc_search_tests { Link Here
901
    $UseQueryParser = 0;
851
    $UseQueryParser = 0;
902
    $marcflavour = 'UNIMARC';
852
    $marcflavour = 'UNIMARC';
903
853
904
    index_sample_records_and_launch_zebra($datadir, $indexing_mode, 'unimarc');
854
    index_sample_records_and_launch_zebra($datadir, 'unimarc');
905
855
906
    my ( $error, $marcresults, $total_hits ) = SimpleSearch("ti=Järnvägarnas efterfrågan och den svenska industrin", 0, 10);
856
    my ( $error, $marcresults, $total_hits ) = SimpleSearch("ti=Järnvägarnas efterfrågan och den svenska industrin", 0, 10);
907
    is($total_hits, 1, 'UNIMARC title search');
857
    is($total_hits, 1, 'UNIMARC title search');
Lines 978-1001 sub run_unimarc_search_tests { Link Here
978
    cleanup();
928
    cleanup();
979
}
929
}
980
930
981
subtest 'MARC21 + GRS-1' => sub {
982
    plan tests => 110;
983
    run_marc21_search_tests('grs1');
984
};
985
986
subtest 'MARC21 + DOM' => sub {
931
subtest 'MARC21 + DOM' => sub {
987
    plan tests => 110;
932
    plan tests => 108;
988
    run_marc21_search_tests('dom');
933
    run_marc21_search_tests();
989
};
990
991
subtest 'UNIMARC + GRS-1' => sub {
992
    plan tests => 14;
993
    run_unimarc_search_tests('grs1');
994
};
934
};
995
935
996
subtest 'UNIMARC + DOM' => sub {
936
subtest 'UNIMARC + DOM' => sub {
997
    plan tests => 14;
937
    plan tests => 14;
998
    run_unimarc_search_tests('dom');
938
    run_unimarc_search_tests();
999
};
939
};
1000
940
1001
# Make sure that following tests are not using our config settings
941
# Make sure that following tests are not using our config settings
(-)a/t/db_dependent/XISBN.t (-4 / +1 lines)
Lines 109-118 sub Mock_SimpleSearch { Link Here
109
    }
109
    }
110
    $record->append_fields($biblionumber_field);
110
    $record->append_fields($biblionumber_field);
111
111
112
    my $indexing_mode = C4::Context->config('zebra_bib_index_mode') // 'dom';
112
    push @results, $record->as_xml();
113
    push @results, ( $indexing_mode eq 'dom' )
114
                    ? $record->as_xml()
115
                    : $record->as_usmarc() ;
116
113
117
    return ( undef, \@results, 1 );
114
    return ( undef, \@results, 1 );
118
}
115
}
(-)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