|
Lines 361-407
sub run_marc21_search_tests {
Link Here
|
| 361 |
|
361 |
|
| 362 |
( undef, $results_hashref, $facets_loop ) = |
362 |
( undef, $results_hashref, $facets_loop ) = |
| 363 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
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/ && |
364 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->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' && |
365 |
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' && |
| 366 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/ |
366 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
| 367 |
, "Simple relevance sorting in getRecords matches old behavior"); |
367 |
, "Simple relevance sorting in getRecords matches old behavior"); |
| 368 |
|
368 |
|
| 369 |
( undef, $results_hashref, $facets_loop ) = |
369 |
( undef, $results_hashref, $facets_loop ) = |
| 370 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
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$/ && |
371 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->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/ && |
372 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->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' |
373 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' |
| 374 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
374 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
| 375 |
|
375 |
|
| 376 |
( undef, $results_hashref, $facets_loop ) = |
376 |
( undef, $results_hashref, $facets_loop ) = |
| 377 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
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' && |
378 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->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/ && |
379 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->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$/ |
380 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ |
| 381 |
, "Simple descending author sorting in getRecords matches old behavior"); |
381 |
, "Simple descending author sorting in getRecords matches old behavior"); |
| 382 |
|
382 |
|
| 383 |
( undef, $results_hashref, $facets_loop ) = |
383 |
( undef, $results_hashref, $facets_loop ) = |
| 384 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
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' && |
385 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->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$/ && |
386 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->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/ |
387 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
| 388 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
388 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
| 389 |
|
389 |
|
| 390 |
( undef, $results_hashref, $facets_loop ) = |
390 |
( undef, $results_hashref, $facets_loop ) = |
| 391 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
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/ && |
392 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->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' && |
393 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->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' |
394 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' |
| 395 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
395 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
| 396 |
|
396 |
TODO: { |
|
|
397 |
local $TODO = "Switch relevance search to MARCXML too"; |
| 397 |
( undef, $results_hashref, $facets_loop ) = |
398 |
( undef, $results_hashref, $facets_loop ) = |
| 398 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
399 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
| 399 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
400 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
| 400 |
is($record->title_proper(), 'books', "Scan returned requested item"); |
401 |
is($record->title_proper(), 'books', "Scan returned requested item"); |
| 401 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
402 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
| 402 |
|
|
|
| 403 |
# Time to test buildQuery and searchResults too. |
403 |
# Time to test buildQuery and searchResults too. |
| 404 |
|
404 |
} |
| 405 |
my ( $query, $simple_query, $query_cgi, |
405 |
my ( $query, $simple_query, $query_cgi, |
| 406 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
406 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 407 |
$stopwords_removed, $query_type ); |
407 |
$stopwords_removed, $query_type ); |
|
Lines 541-550
sub run_marc21_search_tests {
Link Here
|
| 541 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
541 |
($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"); |
542 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
| 543 |
if ($indexing_mode eq 'grs1') { |
543 |
if ($indexing_mode eq 'grs1') { |
| 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"); |
544 |
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"); |
| 545 |
} else { |
545 |
} else { |
| 546 |
local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; |
546 |
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"); |
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 |
} |
548 |
} |
| 549 |
|
549 |
|
| 550 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; |
550 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; |
| 551 |
- |
|
|