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' ) { |
362 |
( undef, $results_hashref, $facets_loop ) = |
363 |
( undef, $results_hashref, $facets_loop ) = |
363 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
364 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
364 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && |
365 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && |
Lines 393-398
sub run_marc21_search_tests {
Link Here
|
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_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
394 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' |
395 |
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"); |
396 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
|
|
397 |
|
398 |
} elsif ( $indexing_mode eq 'grs1' ){ |
399 |
( undef, $results_hashref, $facets_loop ) = |
400 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
401 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ && |
402 |
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' && |
403 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/ |
404 |
, "Simple relevance sorting in getRecords matches old behavior"); |
405 |
|
406 |
( undef, $results_hashref, $facets_loop ) = |
407 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
408 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/la enfermedad laboral\^ies$/ && |
409 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[6])->title_proper() =~ m/^Indicadores de resultados identificados/ && |
410 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'World health statistics 2009^ien' |
411 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
412 |
|
413 |
( undef, $results_hashref, $facets_loop ) = |
414 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
415 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'World health statistics 2009^ien' && |
416 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[12])->title_proper() =~ m/^Indicadores de resultados identificados/ && |
417 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/la enfermedad laboral\^ies$/ |
418 |
, "Simple descending author sorting in getRecords matches old behavior"); |
419 |
|
420 |
( undef, $results_hashref, $facets_loop ) = |
421 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
422 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'Manual de higiene industrial^ies' && |
423 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && |
424 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/ |
425 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
426 |
|
427 |
( undef, $results_hashref, $facets_loop ) = |
428 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
429 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Estado de salud/ && |
430 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' && |
431 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies' |
432 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
433 |
} |
434 |
|
396 |
TODO: { |
435 |
TODO: { |
397 |
local $TODO = "Switch relevance search to MARCXML too"; |
436 |
local $TODO = "Switch relevance search to MARCXML too"; |
398 |
( undef, $results_hashref, $facets_loop ) = |
437 |
( undef, $results_hashref, $facets_loop ) = |
Lines 402-407
TODO: {
Link Here
|
402 |
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"); |
403 |
# Time to test buildQuery and searchResults too. |
442 |
# Time to test buildQuery and searchResults too. |
404 |
} |
443 |
} |
|
|
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, |
407 |
$stopwords_removed, $query_type ); |
447 |
$stopwords_removed, $query_type ); |
Lines 541-547
TODO: {
Link Here
|
541 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
581 |
($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"); |
582 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
543 |
if ($indexing_mode eq 'grs1') { |
583 |
if ($indexing_mode eq 'grs1') { |
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"); |
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_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"); |
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 |
- |
|
|