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

(-)a/C4/Context.pm (-10 / +2 lines)
Lines 616-631 sub _new_Zconn { Link Here
616
        $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom';
616
        $index_mode = $context->{'config'}->{'zebra_auth_index_mode'} // 'dom';
617
    }
617
    }
618
618
619
    if ( $index_mode eq 'grs1' ) {
619
    $syntax = 'xml';
620
        $elementSetName = 'F';
620
    $elementSetName = 'marcxml';
621
        $syntax = ( $context->preference("marcflavour") eq 'UNIMARC' )
622
                ? 'unimarc'
623
                : 'usmarc';
624
625
    } else { # $index_mode eq 'dom'
626
        $syntax = 'xml';
627
        $elementSetName = 'marcxml';
628
    }
629
621
630
    my $host = $context->{'listen'}->{$server}->{'content'};
622
    my $host = $context->{'listen'}->{$server}->{'content'};
631
    my $user = $context->{"serverinfo"}->{$server}->{"user"};
623
    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 458-465 my %config_defaults = ( Link Here
458
  'DB_PASS'           => 'katikoan',
456
  'DB_PASS'           => 'katikoan',
459
  'INSTALL_SRU'       => 'yes',
457
  'INSTALL_SRU'       => 'yes',
460
  'INSTALL_PAZPAR2'   => 'no',
458
  'INSTALL_PAZPAR2'   => 'no',
461
  'AUTH_INDEX_MODE'   => 'dom',
462
  'BIB_INDEX_MODE'    => 'dom',
463
  'ZEBRA_MARC_FORMAT' => 'marc21',
459
  'ZEBRA_MARC_FORMAT' => 'marc21',
464
  'ZEBRA_LANGUAGE'    => 'en',
460
  'ZEBRA_LANGUAGE'    => 'en',
465
  'ZEBRA_TOKENIZER'   => 'chr',
461
  'ZEBRA_TOKENIZER'   => 'chr',
Lines 503-510 my %valid_config_values = ( Link Here
503
  'INSTALL_MODE'  => { 'standard' => 1, 'single' => 1, 'dev' => 1 },
499
  'INSTALL_MODE'  => { 'standard' => 1, 'single' => 1, 'dev' => 1 },
504
  'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
500
  'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
505
  'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
501
  'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
506
  'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 },
507
  'BIB_INDEX_MODE'  => { 'grs1' => 1, 'dom' => 1 },
508
  'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
502
  'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
509
  '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
503
  '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
510
  'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 },
504
  'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 },
Lines 529-536 my $cli_zebra_pass = ""; Link Here
529
my $cli_zebra_sru_host = "";
523
my $cli_zebra_sru_host = "";
530
my $cli_zebra_sru_bib_port = "";
524
my $cli_zebra_sru_bib_port = "";
531
my $cli_zebra_sru_auth_port = "";
525
my $cli_zebra_sru_auth_port = "";
532
my $cli_koha_auth_index_mode = "";
533
my $cli_koha_bib_index_mode = "";
534
my $cli_koha_user = "";
526
my $cli_koha_user = "";
535
my $cli_koha_group = "";
527
my $cli_koha_group = "";
536
my $cli_koha_install_sru = "";
528
my $cli_koha_install_sru = "";
Lines 557-564 my $results = GetOptions( Link Here
557
    "zebra_sru_host=s"             => \$cli_zebra_sru_host,
549
    "zebra_sru_host=s"             => \$cli_zebra_sru_host,
558
    "zebra_sru_biblios_port=s"     => \$cli_zebra_sru_bib_port,
550
    "zebra_sru_biblios_port=s"     => \$cli_zebra_sru_bib_port,
559
    "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port,
551
    "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port,
560
    "auth_index_mode=s"            => \$cli_koha_auth_index_mode,
561
    "bib_index_mode=s"             => \$cli_koha_bib_index_mode,
562
    "koha_user=s"                  => \$cli_koha_user,
552
    "koha_user=s"                  => \$cli_koha_user,
563
    "koha_group=s"                 => \$cli_koha_group,
553
    "koha_group=s"                 => \$cli_koha_group,
564
    "install_sru=s"                => \$cli_koha_install_sru,
554
    "install_sru=s"                => \$cli_koha_install_sru,
Lines 599-613 my $pl_files = { Link Here
599
589
600
push @{ $pl_files->{'rewrite-config.PL'} }, (
590
push @{ $pl_files->{'rewrite-config.PL'} }, (
601
    'blib/ZEBRA_CONF_DIR/etc/passwd',
591
    'blib/ZEBRA_CONF_DIR/etc/passwd',
602
    'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg',
603
    'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
592
    'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg',
604
    'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg',
605
    'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg',
593
    'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg',
606
    'blib/ZEBRA_CONF_DIR/explain-authorities.xml',
594
    'blib/ZEBRA_CONF_DIR/explain-authorities.xml',
607
    'blib/ZEBRA_CONF_DIR/explain-biblios.xml',
595
    'blib/ZEBRA_CONF_DIR/explain-biblios.xml',
608
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml',
609
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
596
    'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
610
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-grs1.xml',
611
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml',
597
    'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml',
612
);
598
);
613
push @{ $pl_files->{'rewrite-config.PL'} }, (
599
push @{ $pl_files->{'rewrite-config.PL'} }, (
Lines 621-639 if ($config{'INSTALL_PAZPAR2'} eq 'yes') { Link Here
621
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
607
        'blib/PAZPAR2_CONF_DIR/pazpar2.xml'
622
    );
608
    );
623
}
609
}
624
$config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom'
610
$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg';
625
                              ? 'zebra-authorities-dom.cfg'
611
$config{'ZEBRA_BIB_CFG'}  = 'zebra-biblios-dom.cfg';
626
                              : 'zebra-authorities.cfg';
612
$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml';
627
$config{'ZEBRA_BIB_CFG'}  = $config{'BIB_INDEX_MODE'} eq 'dom'
613
$config{'BIB_RETRIEVAL_CFG'}  = 'retrieval-info-bib-dom.xml';
628
                              ? 'zebra-biblios-dom.cfg'
629
                              : 'zebra-biblios.cfg';
630
$config{'AUTH_RETRIEVAL_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom'
631
                                  ? 'retrieval-info-auth-dom.xml'
632
                                  : 'retrieval-info-auth-grs1.xml';
633
$config{'BIB_RETRIEVAL_CFG'}  = $config{'BIB_INDEX_MODE'} eq 'dom'
634
                                  ? 'retrieval-info-bib-dom.xml'
635
                                  : 'retrieval-info-bib-grs1.xml';
636
637
614
638
if ($config{'INSTALL_MODE'} ne "dev") {
615
if ($config{'INSTALL_MODE'} ne "dev") {
639
    push @{ $pl_files->{'rewrite-config.PL'} }, (
616
    push @{ $pl_files->{'rewrite-config.PL'} }, (
Lines 845-852 sub get_cli_values { Link Here
845
        ZEBRA_SRU_HOST             => $cli_zebra_sru_host,
822
        ZEBRA_SRU_HOST             => $cli_zebra_sru_host,
846
        ZEBRA_SRU_BIBLIOS_PORT     => $cli_zebra_sru_bib_port,
823
        ZEBRA_SRU_BIBLIOS_PORT     => $cli_zebra_sru_bib_port,
847
        ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port,
824
        ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port,
848
        AUTH_INDEX_MODE            => $cli_koha_auth_index_mode,
849
        BIB_INDEX_MODE             => $cli_koha_bib_index_mode,
850
        KOHA_USER                  => $cli_koha_user,
825
        KOHA_USER                  => $cli_koha_user,
851
        KOHA_GROUP                 => $cli_koha_group,
826
        KOHA_GROUP                 => $cli_koha_group,
852
        INSTALL_SRU                => $cli_koha_install_sru,
827
        INSTALL_SRU                => $cli_koha_install_sru,
Lines 1083-1115 Primary language for Zebra indexing); Link Here
1083
    $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
1058
    $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
1084
1059
1085
    $msg = q(
1060
    $msg = q(
1086
Koha can use one of  two different indexing modes
1087
for the MARC bibliographic records:
1088
1089
dom  - uses the DOM XML filter; offers improved
1090
       functionality.
1091
grs1 - [DEPRECATED] uses the Zebra GRS-1 filter,
1092
       available for legacy support
1093
1094
Bibliographic indexing mode);
1095
    $msg .= _add_valid_values_disp('BIB_INDEX_MODE', $valid_values);
1096
    $config{'BIB_INDEX_MODE'} = _get_value('BIB_INDEX_MODE', $msg, $defaults->{'BIB_INDEX_MODE'}, $valid_values, $install_log_values);
1097
1098
1099
    $msg = q(
1100
Koha can use one of  two different indexing modes
1101
for the MARC authorities records:
1102
1103
dom  - uses the DOM XML filter; offers improved
1104
       functionality.
1105
grs1 - [DEPRECATED] uses the Zebra GRS-1 filter,
1106
       available for legacy support
1107
1108
Authorities indexing mode);
1109
    $msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values);
1110
    $config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values);
1111
1112
    $msg = q(
1113
Zebra has two methods to perform records tokenization
1061
Zebra has two methods to perform records tokenization
1114
and characters normalization: CHR and ICU. ICU is
1062
and characters normalization: CHR and ICU. ICU is
1115
recommended for catalogs containing non-Latin
1063
recommended for catalogs containing non-Latin
(-)a/about.pl (-64 / +8 lines)
Lines 133-190 my @xml_config_warnings; Link Here
133
133
134
my $context = new C4::Context;
134
my $context = new C4::Context;
135
135
136
if ( ! defined C4::Context->config('zebra_bib_index_mode') ) {
136
if (    C4::Context->config('zebra_bib_index_mode')
137
    push @xml_config_warnings, {
137
    and C4::Context->config('zebra_bib_index_mode') eq 'grs1' )
138
        error => 'zebra_bib_index_mode_warn'
138
{
139
    };
139
    push @xml_config_warnings, { error => 'zebra_bib_index_mode_is_grs1' };
140
    if ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) {
141
        push @xml_config_warnings, {
142
            error => 'zebra_bib_mode_seems_grs1'
143
        };
144
    }
145
    else {
146
        push @xml_config_warnings, {
147
            error => 'zebra_bib_mode_seems_dom'
148
        };
149
    }
150
} else {
151
    push @xml_config_warnings, { error => 'zebra_bib_grs_warn' }
152
        if C4::Context->config('zebra_bib_index_mode') eq 'grs1';
153
}
154
155
if ( (C4::Context->config('zebra_bib_index_mode') eq 'dom') &&
156
     ($context->{'server'}->{'biblioserver'}->{'config'} !~ /zebra-biblios-dom.cfg/) ) {
157
158
    push @xml_config_warnings, {
159
        error => 'zebra_bib_index_mode_mismatch_warn'
160
    };
161
}
162
163
if ( (C4::Context->config('zebra_bib_index_mode') eq 'grs1') &&
164
     ($context->{'server'}->{'biblioserver'}->{'config'} =~ /zebra-biblios-dom.cfg/) ) {
165
166
    push @xml_config_warnings, {
167
        error => 'zebra_bib_index_mode_mismatch_warn'
168
    };
169
}
140
}
170
141
171
if ( ! defined C4::Context->config('zebra_auth_index_mode') ) {
142
if (    C4::Context->config('zebra_auth_index_mode')
172
    push @xml_config_warnings, {
143
    and C4::Context->config('zebra_auth_index_mode') eq 'grs1' )
173
        error => 'zebra_auth_index_mode_warn'
144
{
174
    };
145
    push @xml_config_warnings, { error => 'zebra_auth_index_mode_is_grs1' };
175
    if ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) {
176
        push @xml_config_warnings, {
177
            error => 'zebra_auth_mode_seems_grs1'
178
        };
179
    }
180
    else {
181
        push @xml_config_warnings, {
182
            error => 'zebra_auth_mode_seems_dom'
183
        };
184
    }
185
} else {
186
    push @xml_config_warnings, { error => 'zebra_auth_grs_warn' }
187
        if C4::Context->config('zebra_auth_index_mode') eq 'grs1';
188
}
146
}
189
147
190
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
148
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
Lines 193-204 if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'ser Link Here
193
    };
151
    };
194
}
152
}
195
153
196
if ( (C4::Context->config('zebra_auth_index_mode') eq 'grs1') && ($context->{'server'}->{'authorityserver'}->{'config'} =~ /zebra-authorities-dom.cfg/) ) {
197
    push @xml_config_warnings, {
198
        error => 'zebra_auth_index_mode_mismatch_warn'
199
    };
200
}
201
202
if ( ! defined C4::Context->config('log4perl_conf') ) {
154
if ( ! defined C4::Context->config('log4perl_conf') ) {
203
    push @xml_config_warnings, {
155
    push @xml_config_warnings, {
204
        error => 'log4perl_entry_missing'
156
        error => 'log4perl_entry_missing'
Lines 250-263 if ( C4::Context->preference( 'UseQueryParser' ) ) { Link Here
250
# Test Zebra facets configuration
202
# Test Zebra facets configuration
251
if ( !defined C4::Context->config('use_zebra_facets') ) {
203
if ( !defined C4::Context->config('use_zebra_facets') ) {
252
    push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
204
    push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' };
253
} else {
254
    if ( C4::Context->config('use_zebra_facets') &&
255
         C4::Context->config('zebra_bib_index_mode') ) {
256
        # use_zebra_facets works with DOM
257
        push @xml_config_warnings, {
258
            error => 'use_zebra_facets_needs_dom'
259
        } if C4::Context->config('zebra_bib_index_mode') ne 'dom' ;
260
    }
261
}
205
}
262
206
263
# Sco Patron should not contain any other perms than circulate => self_checkout
207
# Sco Patron should not contain any other perms than circulate => self_checkout
(-)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 97-104 generate_config_file() { Link Here
97
        -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \
97
        -e "s/__SRU_BIBLIOS_PORT__/$SRU_SERVER_PORT/g" \
98
        -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \
98
        -e "s/__START_SRU_PUBLICSERVER__/$START_SRU_PUBLICSERVER/g" \
99
        -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \
99
        -e "s/__END_SRU_PUBLICSERVER__/$END_SRU_PUBLICSERVER/g" \
100
        -e "s/__BIBLIOS_INDEXING_MODE__/$BIBLIOS_INDEXING_MODE/g" \
101
        -e "s/__AUTHORITIES_INDEXING_MODE__/$AUTHORITIES_INDEXING_MODE/g" \
102
        -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
100
        -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
103
        -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
101
        -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
104
        -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
102
        -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
Lines 214-284 EOM Link Here
214
212
215
set_biblios_indexing_mode()
213
set_biblios_indexing_mode()
216
{
214
{
217
    local indexing_mode=$1
215
    local marc_format=$1
218
    local marc_format=$2
219
216
220
    case $indexing_mode in
217
    START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
221
        "dom")
222
            START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
223
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
218
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
224
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
219
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
225
     <xi:fallback>\n
220
     <xi:fallback>\n
226
      <retrievalinfo>
221
      <retrievalinfo>
227
EOF`
222
EOF`
228
223
229
            END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
224
    END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
230
      <\/retrievalinfo>\n
225
      <\/retrievalinfo>\n
231
     <\/xi:fallback>\n
226
     <\/xi:fallback>\n
232
    <\/xi:include>
227
    <\/xi:include>
233
EOF`
228
EOF`
234
            BIBLIOS_INDEXING_MODE="dom"
229
    ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
235
            ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
236
            ;;
237
        "grs1")
238
            START_BIBLIOS_RETRIEVAL_INFO="    <retrievalinfo>"
239
            END_BIBLIOS_RETRIEVAL_INFO="    <\/retrievalinfo>"
240
            BIBLIOS_INDEXING_MODE="grs1"
241
            ZEBRA_BIBLIOS_CFG="zebra-biblios.cfg"
242
            ;;
243
        *)
244
            die "Error: '$indexing_mode' is not a valid indexing mode for bibliographic records."
245
            ;;
246
    esac
247
}
230
}
248
231
249
232
250
set_authorities_indexing_mode()
233
set_authorities_indexing_mode()
251
{
234
{
252
    local indexing_mode=$1
235
    local marc_format=$1
253
    local marc_format=$2
254
236
255
    case $indexing_mode in
237
    START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
256
        "dom")
257
            START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
258
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
238
    <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
259
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
239
                xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
260
     <xi:fallback>\n
240
     <xi:fallback>\n
261
      <retrievalinfo>
241
      <retrievalinfo>
262
EOF`
242
EOF`
263
243
264
            END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
244
    END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
265
      <\/retrievalinfo>\n
245
      <\/retrievalinfo>\n
266
     <\/xi:fallback>\n
246
     <\/xi:fallback>\n
267
    <\/xi:include>\n
247
    <\/xi:include>\n
268
EOF`
248
EOF`
269
            AUTHORITIES_INDEXING_MODE="dom"
249
    ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
270
            ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
271
            ;;
272
        "grs1")
273
            START_AUTHORITIES_RETRIEVAL_INFO="    <retrievalinfo>"
274
            END_AUTHORITIES_RETRIEVAL_INFO="    <\/retrievalinfo>"
275
            AUTHORITIES_INDEXING_MODE="grs1"
276
            ZEBRA_AUTHORITIES_CFG="zebra-authorities.cfg"
277
            ;;
278
        *)
279
            die "Error: '$indexing_mode' is not a valid indexing mode for authority records."
280
            ;;
281
    esac
282
}
250
}
283
251
284
252
Lines 414-423 DEFAULT_SRU_SERVER_PORT="7090" Link Here
414
START_SRU_PUBLICSERVER="<!--"
382
START_SRU_PUBLICSERVER="<!--"
415
END_SRU_PUBLICSERVER="-->"
383
END_SRU_PUBLICSERVER="-->"
416
384
417
# Indexing mode variables (default is DOM)
418
BIBLIOS_INDEXING_MODE="dom"
419
AUTHORITIES_INDEXING_MODE="dom"
420
421
START_BIBLIOS_RETRIEVAL_INFO=""
385
START_BIBLIOS_RETRIEVAL_INFO=""
422
END_BIBLIOS_RETRIEVAL_INFO=""
386
END_BIBLIOS_RETRIEVAL_INFO=""
423
START_AUTHORITIES_RETRIEVAL_INFO=""
387
START_AUTHORITIES_RETRIEVAL_INFO=""
Lines 443-450 CLO_ZEBRA_MARC_FORMAT="" Link Here
443
CLO_ZEBRA_LANGUAGE=""
407
CLO_ZEBRA_LANGUAGE=""
444
CLO_DEFAULTSQL=""
408
CLO_DEFAULTSQL=""
445
CLO_ADMINUSER=""
409
CLO_ADMINUSER=""
446
CLO_BIBLIOS_INDEXING_MODE=""
447
CLO_AUTHORITIES_INDEXING_MODE=""
448
CLO_MEMCACHED_SERVERS=""
410
CLO_MEMCACHED_SERVERS=""
449
CLO_MEMCACHED_PREFIX=""
411
CLO_MEMCACHED_PREFIX=""
450
CLO_UPLOAD_PATH=""
412
CLO_UPLOAD_PATH=""
Lines 470-479 while true ; do Link Here
470
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
432
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
471
        -l|--zebralang)
433
        -l|--zebralang)
472
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
434
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
473
        --auth-idx)
474
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
475
        --biblio-idx)
476
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
477
        -d|--defaultsql)
435
        -d|--defaultsql)
478
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
436
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
479
        -f|--configfile)
437
        -f|--configfile)
Lines 534-554 then Link Here
534
    PASSWDFILE="$CLO_PASSWDFILE"
492
    PASSWDFILE="$CLO_PASSWDFILE"
535
fi
493
fi
536
494
537
if [ "$CLO_BIBLIOS_INDEXING_MODE" !=  "" ]; then
495
set_biblios_indexing_mode $ZEBRA_MARC_FORMAT
538
    BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE
539
fi
540
541
set_biblios_indexing_mode $BIBLIOS_INDEXING_MODE $ZEBRA_MARC_FORMAT
542
496
543
if [ "$ENABLE_SRU" != "no" ]; then
497
if [ "$ENABLE_SRU" != "no" ]; then
544
    enable_sru_server
498
    enable_sru_server
545
fi
499
fi
546
500
547
if [ "$CLO_AUTHORITIES_INDEXING_MODE" !=  "" ]; then
501
set_authorities_indexing_mode $ZEBRA_MARC_FORMAT
548
    AUTHORITIES_INDEXING_MODE=$CLO_AUTHORITIES_INDEXING_MODE
549
fi
550
551
set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT
552
502
553
name="$1"
503
name="$1"
554
504
Lines 698-709 eof Link Here
698
        "/etc/koha/sites/$name/log4perl.conf"
648
        "/etc/koha/sites/$name/log4perl.conf"
699
649
700
    # Generate and install Zebra config files.
650
    # Generate and install Zebra config files.
701
    generate_config_file zebra-biblios-site.cfg.in \
702
        "/etc/koha/sites/$name/zebra-biblios.cfg"
703
    generate_config_file zebra-biblios-dom-site.cfg.in \
651
    generate_config_file zebra-biblios-dom-site.cfg.in \
704
        "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
652
        "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
705
    generate_config_file zebra-authorities-site.cfg.in \
706
        "/etc/koha/sites/$name/zebra-authorities.cfg"
707
    generate_config_file zebra-authorities-dom-site.cfg.in \
653
    generate_config_file zebra-authorities-dom-site.cfg.in \
708
        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
654
        "/etc/koha/sites/$name/zebra-authorities-dom.cfg"
709
    generate_config_file zebra.passwd.in \
655
    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 110-117 __PAZPAR2_TOGGLE_XML_POST__ Link Here
110
 <install_log>__MISC_DIR__/koha-install-log</install_log>
110
 <install_log>__MISC_DIR__/koha-install-log</install_log>
111
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
111
 <useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
112
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
112
 <useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
113
 <zebra_bib_index_mode>__BIB_INDEX_MODE__</zebra_bib_index_mode>
114
 <zebra_auth_index_mode>__AUTH_INDEX_MODE__</zebra_auth_index_mode>
115
 <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
113
 <zebra_lockdir>__ZEBRA_LOCK_DIR__</zebra_lockdir>
116
 <use_zebra_facets>1</use_zebra_facets>
114
 <use_zebra_facets>1</use_zebra_facets>
117
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
115
 <queryparser_config>__KOHA_CONF_DIR__/searchengine/queryparser.yaml</queryparser_config>
(-)a/install_misc/environment_Makefile.PL (-5 lines)
Lines 55-65 export DB_NAME='koha' Link Here
55
export DB_USER='kohaadmin'
55
export DB_USER='kohaadmin'
56
export DB_PASS='katikoan'
56
export DB_PASS='katikoan'
57
57
58
#export AUTH_INDEX_MODE=grs1
59
export AUTH_INDEX_MODE=dom
60
#export BIB_INDEX_MODE=grs1
61
export BIB_INDEX_MODE=dom
62
63
#export ZEBRA_MARC_FORMAT=unimarc
58
#export ZEBRA_MARC_FORMAT=unimarc
64
export ZEBRA_MARC_FORMAT=marc21
59
export ZEBRA_MARC_FORMAT=marc21
65
60
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-59 / +4 lines)
Lines 196-265 Link Here
196
            <table>
196
            <table>
197
                <caption>XML configuration file</caption>
197
                <caption>XML configuration file</caption>
198
            [% FOREACH config_entry IN xml_config_warnings %]
198
            [% FOREACH config_entry IN xml_config_warnings %]
199
                [% IF config_entry.error == 'zebra_bib_index_mode_warn' %]
199
                [% IF config_entry.error == 'zebra_bib_index_mode_is_grs1' %]
200
                <tr>
200
                <tr>
201
                    <th scope="row"><b>Warning</b></th>
201
                    <th scope="row"><b>Warning</b></th>
202
                    <td>The &lt;zebra_bib_index_mode&gt; entry is missing in your configuration file.
202
                    <td>The &lt;zebra_bib_index_mode&gt; entry set to 'grs1', which is no longer supported.
203
                        It should be set to 'dom' or 'grs1' (deprecated).
204
                        It will default to 'dom'.
205
                    </td>
206
                </tr>
207
                [% ELSIF config_entry.error == 'zebra_bib_mode_seems_grs1' %]
208
                <tr>
209
                    <th scope="row"><b>Info</b></th>
210
                    <td>Your configuration file still seems to be set up for 'grs1'.</td>
211
                </tr>
212
                [% ELSIF config_entry.error == 'zebra_bib_mode_seems_dom' %]
213
                <tr>
214
                    <th scope="row"><b>Info</b></th>
215
                    <td>Your configuration file seems to be set up for 'dom'.</td>
216
                </tr>
217
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %]
218
                <tr>
219
                    <th scope="row"><b>Warning</b></th>
220
                    <td>The &lt;zebra_auth_index_mode&gt; entry is missing in your configuration file.
221
                        It should be set to 'dom' or 'grs1' (deprecated).
222
                        It will default to 'dom'.
223
                    </td>
224
                </tr>
225
                [% ELSIF config_entry.error == 'zebra_auth_mode_seems_grs1' %]
226
                <tr>
227
                    <th scope="row"><b>Info</b></th>
228
                    <td>Your configuration file still seems to be set up for 'grs1'.</td>
229
                </tr>
230
                [% ELSIF config_entry.error == 'zebra_auth_mode_seems_dom' %]
231
                <tr>
232
                    <th scope="row"><b>Info</b></th>
233
                    <td>Your configuration file seems to be set up for 'dom'.</td>
234
                </tr>
235
                [% ELSIF config_entry.error == 'zebra_bib_grs_warn' %]
236
                <tr>
237
                    <th scope="row"><b>Warning</b></th>
238
                    <td>The &lt;zebra_bib_index_mode&gt; entry is set to 'grs1'.
239
                        GRS-1 support is now deprecated and will be removed in future releases.
240
                        Please use DOM instead. To switch follow this page of wiki:
203
                        Please use DOM instead. To switch follow this page of wiki:
241
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
204
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
242
                    </td>
205
                    </td>
243
                </tr>
206
                </tr>
244
                [% ELSIF config_entry.error == 'zebra_bib_index_mode_mismatch_warn' %]
207
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_is_grs1' %]
245
                <tr>
208
                <tr>
246
                    <th scope="row"><b>Warning</b></th>
209
                    <th scope="row"><b>Warning</b></th>
247
                    <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>
210
                    <td>The &lt;zebra_auth_index_mode&gt; entry set to 'grs1', which is no longer supported.
248
                </tr>
249
                [% ELSIF config_entry.error == 'zebra_auth_grs_warn' %]
250
                <tr>
251
                    <th scope="row"><b>Warning</b></th>
252
                    <td>The &lt;zebra_auth_index_mode&gt; entry is set to 'grs1'.
253
                        GRS-1 support is now deprecated and will be removed in future releases.
254
                        Please use DOM instead. To switch follow this page of wiki:
211
                        Please use DOM instead. To switch follow this page of wiki:
255
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
212
                        <a href="https://wiki.koha-community.org/wiki/Switching_to_dom_indexing">Switching to dom indexing</a>
256
                    </td>
213
                    </td>
257
                </tr>
214
                </tr>
258
                [% ELSIF config_entry.error == 'zebra_auth_index_mode_mismatch_warn' %]
259
                <tr>
260
                    <th scope="row"><b>Warning</b></th>
261
                    <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>
262
                </tr>
263
                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
215
                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
264
                <tr>
216
                <tr>
265
                    <th scope="row"><b>Warning</b></th>
217
                    <th scope="row"><b>Warning</b></th>
Lines 274-286 Link Here
274
                        to legacy facet calculation.
226
                        to legacy facet calculation.
275
                    </td>
227
                    </td>
276
                </tr>
228
                </tr>
277
                [% ELSIF config_entry.error == 'use_zebra_facets_needs_dom' %]
278
                <tr>
279
                    <th scope="row"><b>Warning</b></th>
280
                    <td>You have set &lt;use_zebra_facets&gt; but the &lt;zebra_bib_index_mode&gt; is not set to 'dom'. Falling back
281
                        to legacy facet calculation.
282
                    </td>
283
                </tr>
284
                [% ELSIF config_entry.error == 'log4perl_entry_missing' %]
229
                [% ELSIF config_entry.error == 'log4perl_entry_missing' %]
285
                <tr>
230
                <tr>
286
                    <th scope="row"><b>Warning</b></th>
231
                    <th scope="row"><b>Warning</b></th>
(-)a/misc/koha-install-log (-2 lines)
Lines 56-63 INSTALL_BASE=__INSTALL_BASE__ Link Here
56
INSTALL_ZEBRA=__INSTALL_ZEBRA__
56
INSTALL_ZEBRA=__INSTALL_ZEBRA__
57
INSTALL_SRU=__INSTALL_SRU__
57
INSTALL_SRU=__INSTALL_SRU__
58
INSTALL_PAZPAR2=__INSTALL_PAZPAR2__
58
INSTALL_PAZPAR2=__INSTALL_PAZPAR2__
59
BIB_INDEX_MODE=__BIB_INDEX_MODE__
60
AUTH_INDEX_MODE=__AUTH_INDEX_MODE__
61
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
59
ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__
62
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
60
RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__
63
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__
61
PATH_TO_ZEBRA=__PATH_TO_ZEBRA__
(-)a/misc/migration_tools/rebuild_zebra.pl (-4 / +1 lines)
Lines 164-171 my $biblioserverdir = C4::Context->zebraconfig('biblioserver')->{directory}; Link Here
164
my $authorityserverdir = C4::Context->zebraconfig('authorityserver')->{directory};
164
my $authorityserverdir = C4::Context->zebraconfig('authorityserver')->{directory};
165
165
166
my $kohadir = C4::Context->config('intranetdir');
166
my $kohadir = C4::Context->config('intranetdir');
167
my $bib_index_mode  = C4::Context->config('zebra_bib_index_mode')  // 'dom';
168
my $auth_index_mode = C4::Context->config('zebra_auth_index_mode') // 'dom';
169
167
170
my ($biblionumbertagfield,$biblionumbertagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
168
my ($biblionumbertagfield,$biblionumbertagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
171
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaField("biblioitems.biblioitemnumber","");
169
my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaField("biblioitems.biblioitemnumber","");
Lines 273-280 if ($keep_export) { Link Here
273
        print "parameter";
271
        print "parameter";
274
    }
272
    }
275
    print "\n";
273
    print "\n";
276
    print "if you just want to rebuild zebra after changing the record.abs\n";
274
    print "if you just want to rebuild zebra after changing zebra config files\n";
277
    print "or another zebra config file\n";
278
} else {
275
} else {
279
    unless ($use_tempdir) {
276
    unless ($use_tempdir) {
280
        # if we're using a temporary directory
277
        # if we're using a temporary directory
(-)a/rewrite-config.PL (-6 / +4 lines)
Lines 127-136 $prefix = $ENV{'INSTALL_BASE'} || "/usr"; Link Here
127
  '__ZEBRA_TOKENIZER__' => 'chr',
127
  '__ZEBRA_TOKENIZER__' => 'chr',
128
  '__ZEBRA_TOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
128
  '__ZEBRA_TOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
129
  '__ZEBRA_PTOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
129
  '__ZEBRA_PTOKENIZER_STMT__' => 'charmap word-phrase-utf.chr',
130
  '__ZEBRA_AUTH_CFG__' => 'zebra-authorities.cfg',
130
  '__AUTH_RETRIEVAL_CFG__' => 'retrieval-info-auth-dom.xml',
131
  '__ZEBRA_BIB_CFG__' => 'zebra-biblios.cfg',
131
  '__BIB_RETRIEVAL_CFG__' => 'retrieval-info-bib-dom.xml',
132
  '__AUTH_RETRIEVAL_CFG__' => 'retrieval-info-auth-grs1.xml',
132
  '__ZEBRA_AUTH_CFG__' => 'zebra-authorities-dom.cfg',
133
  '__BIB_RETRIEVAL_CFG__' => 'retrieval-info-bib-grs1.xml',
133
  '__ZEBRA_BIB_CFG__' => 'zebra-biblios-dom.cfg',
134
  "__MERGE_SERVER_HOST__" => $myhost,
134
  "__MERGE_SERVER_HOST__" => $myhost,
135
  "__MERGE_SERVER_PORT__" => '11001',
135
  "__MERGE_SERVER_PORT__" => '11001',
136
  "__PAZPAR2_HOST__" => $myhost,
136
  "__PAZPAR2_HOST__" => $myhost,
Lines 141-148 $prefix = $ENV{'INSTALL_BASE'} || "/usr"; Link Here
141
  "__INSTALL_PAZPAR2__" => 'no',
141
  "__INSTALL_PAZPAR2__" => 'no',
142
  "__PAZPAR2_TOGGLE_XML_PRE__" => '<!--',
142
  "__PAZPAR2_TOGGLE_XML_PRE__" => '<!--',
143
  "__PAZPAR2_TOGGLE_XML_POST__" => '-->',
143
  "__PAZPAR2_TOGGLE_XML_POST__" => '-->',
144
  "__AUTH_INDEX_MODE__" => 'grs1',
145
  "__BIB_INDEX_MODE__" => 'grs1',
146
  "__RUN_DATABASE_TESTS__" => 'no',
144
  "__RUN_DATABASE_TESTS__" => 'no',
147
  "__PATH_TO_ZEBRA__" => "",
145
  "__PATH_TO_ZEBRA__" => "",
148
  "__USE_MEMCACHED__" => 'no',
146
  "__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 199-207 sub mock_GetMarcSubfieldStructure { Link Here
199
}
199
}
200
200
201
sub run_marc21_search_tests {
201
sub run_marc21_search_tests {
202
    my $indexing_mode = shift;
203
    $datadir = tempdir();
202
    $datadir = tempdir();
204
    system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21 $indexing_mode");
203
    system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21");
205
204
206
    Koha::Caches->get_instance('config')->flush_all;
205
    Koha::Caches->get_instance('config')->flush_all;
207
206
Lines 209-219 sub run_marc21_search_tests { Link Here
209
    my $context = new C4::Context("$datadir/etc/koha-conf.xml");
208
    my $context = new C4::Context("$datadir/etc/koha-conf.xml");
210
    $context->set_context();
209
    $context->set_context();
211
210
212
    is($context->config('zebra_bib_index_mode'),$indexing_mode,
213
        "zebra_bib_index_mode is properly set to '$indexing_mode' in the created koha-conf.xml file (BZ11499)");
214
    is($context->config('zebra_auth_index_mode'),$indexing_mode,
215
        "zebra_auth_index_mode is properly set to '$indexing_mode' in the created koha-conf.xml file (BZ11499)");
216
217
    use_ok('C4::Search');
211
    use_ok('C4::Search');
218
212
219
    # set search syspreferences to a known starting point
213
    # set search syspreferences to a known starting point
Lines 255-261 sub run_marc21_search_tests { Link Here
255
        'VM' => { 'imageurl' => 'bridge/dvd.gif', 'summary' => '', 'itemtype' => 'VM', 'description' => 'Visual Materials' },
249
        'VM' => { 'imageurl' => 'bridge/dvd.gif', 'summary' => '', 'itemtype' => 'VM', 'description' => 'Visual Materials' },
256
    );
250
    );
257
251
258
    index_sample_records_and_launch_zebra($datadir, $indexing_mode, 'marc21');
252
    index_sample_records_and_launch_zebra($datadir, 'marc21');
259
253
260
    my ($biblionumber, $title);
254
    my ($biblionumber, $title);
261
    my $record = MARC::Record->new;
255
    my $record = MARC::Record->new;
Lines 322-399 sub run_marc21_search_tests { Link Here
322
        getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
316
        getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
323
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records");
317
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records");
324
318
325
if ( $indexing_mode eq 'dom' ) {
319
( undef, $results_hashref, $facets_loop ) =
326
    ( undef, $results_hashref, $facets_loop ) =
320
    getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
327
        getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
321
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ &&
328
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ &&
322
    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' &&
329
        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' &&
323
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
330
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
324
    , "Simple relevance sorting in getRecords matches old behavior");
331
        , "Simple relevance sorting in getRecords matches old behavior");
325
332
326
( undef, $results_hashref, $facets_loop ) =
333
    ( undef, $results_hashref, $facets_loop ) =
327
    getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
334
        getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
328
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ &&
335
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ &&
329
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
336
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
330
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien'
337
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien'
331
    , "Simple ascending author sorting in getRecords matches old behavior");
338
        , "Simple ascending author sorting in getRecords matches old behavior");
332
339
333
( undef, $results_hashref, $facets_loop ) =
340
    ( undef, $results_hashref, $facets_loop ) =
334
    getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
341
        getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
335
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
342
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
336
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
343
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ &&
337
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/
344
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/
338
    , "Simple descending author sorting in getRecords matches old behavior");
345
        , "Simple descending author sorting in getRecords matches old behavior");
339
346
340
( undef, $results_hashref, $facets_loop ) =
347
    ( undef, $results_hashref, $facets_loop ) =
341
    getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
348
        getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
342
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' &&
349
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' &&
343
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ &&
350
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ &&
344
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
351
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/
345
    , "Simple ascending publication date sorting in getRecords matches old behavior");
352
        , "Simple ascending publication date sorting in getRecords matches old behavior");
346
353
347
( undef, $results_hashref, $facets_loop ) =
354
    ( undef, $results_hashref, $facets_loop ) =
348
    getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
355
        getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
349
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ &&
356
    ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ &&
350
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
357
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' &&
351
    MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies'
358
        MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies'
352
    , "Simple descending publication date sorting in getRecords matches old behavior");
359
        , "Simple descending publication date sorting in getRecords matches old behavior");
360
361
} elsif ( $indexing_mode eq 'grs1' ){
362
    ( undef, $results_hashref, $facets_loop ) =
363
        getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
364
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ &&
365
        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' &&
366
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/
367
        , "Simple relevance sorting in getRecords matches old behavior");
368
369
    ( undef, $results_hashref, $facets_loop ) =
370
        getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
371
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/la enfermedad laboral\^ies$/ &&
372
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[6])->title_proper() =~ m/^Indicadores de resultados identificados/ &&
373
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'World health statistics 2009^ien'
374
        , "Simple ascending author sorting in getRecords matches old behavior");
375
376
    ( undef, $results_hashref, $facets_loop ) =
377
        getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
378
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'World health statistics 2009^ien' &&
379
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[12])->title_proper() =~ m/^Indicadores de resultados identificados/ &&
380
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/la enfermedad laboral\^ies$/
381
        , "Simple descending author sorting in getRecords matches old behavior");
382
383
    ( undef, $results_hashref, $facets_loop ) =
384
        getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
385
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'Manual de higiene industrial^ies' &&
386
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ &&
387
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/
388
        , "Simple ascending publication date sorting in getRecords matches old behavior");
389
390
    ( undef, $results_hashref, $facets_loop ) =
391
        getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
392
    ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Estado de salud/ &&
393
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' &&
394
        MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies'
395
        , "Simple descending publication date sorting in getRecords matches old behavior");
396
}
397
353
398
    ( undef, $results_hashref, $facets_loop ) =
354
    ( undef, $results_hashref, $facets_loop ) =
399
        getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1);
355
        getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1);
Lines 540-551 if ( $indexing_mode eq 'dom' ) { Link Here
540
496
541
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
497
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
542
    is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results");
498
    is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results");
543
    if ($indexing_mode eq 'grs1') {
499
    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");
544
        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");
545
    } else {
546
        local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS";
547
        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
    }
549
500
550
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = 0;
501
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = 0;
551
    $QueryAutoTruncate = 1;
502
    $QueryAutoTruncate = 1;
Lines 868-876 if ( $indexing_mode eq 'dom' ) { Link Here
868
}
819
}
869
820
870
sub run_unimarc_search_tests {
821
sub run_unimarc_search_tests {
871
    my $indexing_mode = shift;
872
    $datadir = tempdir();
822
    $datadir = tempdir();
873
    system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc $indexing_mode");
823
    system(dirname(__FILE__) . "/zebra_config.pl $datadir unimarc");
874
824
875
    Koha::Caches->get_instance('config')->flush_all;
825
    Koha::Caches->get_instance('config')->flush_all;
876
826
Lines 888-894 sub run_unimarc_search_tests { Link Here
888
    $UseQueryParser = 0;
838
    $UseQueryParser = 0;
889
    $marcflavour = 'UNIMARC';
839
    $marcflavour = 'UNIMARC';
890
840
891
    index_sample_records_and_launch_zebra($datadir, $indexing_mode, 'unimarc');
841
    index_sample_records_and_launch_zebra($datadir, 'unimarc');
892
842
893
    my ( $error, $marcresults, $total_hits ) = SimpleSearch("ti=Järnvägarnas efterfrågan och den svenska industrin", 0, 10);
843
    my ( $error, $marcresults, $total_hits ) = SimpleSearch("ti=Järnvägarnas efterfrågan och den svenska industrin", 0, 10);
894
    is($total_hits, 1, 'UNIMARC title search');
844
    is($total_hits, 1, 'UNIMARC title search');
Lines 961-984 sub run_unimarc_search_tests { Link Here
961
    cleanup();
911
    cleanup();
962
}
912
}
963
913
964
subtest 'MARC21 + GRS-1' => sub {
965
    plan tests => 109;
966
    run_marc21_search_tests('grs1');
967
};
968
969
subtest 'MARC21 + DOM' => sub {
914
subtest 'MARC21 + DOM' => sub {
970
    plan tests => 109;
915
    plan tests => 107;
971
    run_marc21_search_tests('dom');
916
    run_marc21_search_tests();
972
};
973
974
subtest 'UNIMARC + GRS-1' => sub {
975
    plan tests => 14;
976
    run_unimarc_search_tests('grs1');
977
};
917
};
978
918
979
subtest 'UNIMARC + DOM' => sub {
919
subtest 'UNIMARC + DOM' => sub {
980
    plan tests => 14;
920
    plan tests => 14;
981
    run_unimarc_search_tests('dom');
921
    run_unimarc_search_tests();
982
};
922
};
983
923
984
# Make sure that following tests are not using our config settings
924
# 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