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 |