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 |