|
Lines 359-364
sub run_marc21_search_tests {
Link Here
|
| 359 |
getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
359 |
getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 360 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); |
360 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); |
| 361 |
|
361 |
|
|
|
362 |
if ( $indexing_mode eq 'dom' ) { |
| 363 |
( undef, $results_hashref, $facets_loop ) = |
| 364 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 365 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && |
| 366 |
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' && |
| 367 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
| 368 |
, "Simple relevance sorting in getRecords matches old behavior"); |
| 369 |
|
| 370 |
( undef, $results_hashref, $facets_loop ) = |
| 371 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 372 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && |
| 373 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
| 374 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' |
| 375 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
| 376 |
|
| 377 |
( undef, $results_hashref, $facets_loop ) = |
| 378 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 379 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
| 380 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
| 381 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ |
| 382 |
, "Simple descending author sorting in getRecords matches old behavior"); |
| 383 |
|
| 384 |
( undef, $results_hashref, $facets_loop ) = |
| 385 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 386 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && |
| 387 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && |
| 388 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
| 389 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
| 390 |
|
| 391 |
( undef, $results_hashref, $facets_loop ) = |
| 392 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 393 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && |
| 394 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
| 395 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' |
| 396 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
| 397 |
|
| 398 |
} elsif ( $indexing_mode eq 'grs1' ){ |
| 362 |
( undef, $results_hashref, $facets_loop ) = |
399 |
( undef, $results_hashref, $facets_loop ) = |
| 363 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
400 |
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/ && |
401 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ && |
|
Lines 393-406
sub run_marc21_search_tests {
Link Here
|
| 393 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' && |
430 |
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' |
431 |
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"); |
432 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
|
|
433 |
} |
| 396 |
|
434 |
|
|
|
435 |
TODO: { |
| 436 |
local $TODO = "Switch relevance search to MARCXML too"; |
| 397 |
( undef, $results_hashref, $facets_loop ) = |
437 |
( undef, $results_hashref, $facets_loop ) = |
| 398 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
438 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
| 399 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
439 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
| 400 |
is($record->title_proper(), 'books', "Scan returned requested item"); |
440 |
is($record->title_proper(), 'books', "Scan returned requested item"); |
| 401 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
441 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
| 402 |
|
|
|
| 403 |
# Time to test buildQuery and searchResults too. |
442 |
# Time to test buildQuery and searchResults too. |
|
|
443 |
} |
| 404 |
|
444 |
|
| 405 |
my ( $query, $simple_query, $query_cgi, |
445 |
my ( $query, $simple_query, $query_cgi, |
| 406 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
446 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
|
Lines 544-550
sub run_marc21_search_tests {
Link Here
|
| 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"); |
584 |
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 { |
585 |
} else { |
| 546 |
local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; |
586 |
local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; |
| 547 |
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"); |
587 |
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 |
} |
588 |
} |
| 549 |
|
589 |
|
| 550 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; |
590 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; |
| 551 |
- |
|
|