Lines 346-392
sub run_marc21_search_tests {
Link Here
|
346 |
|
346 |
|
347 |
( undef, $results_hashref, $facets_loop ) = |
347 |
( undef, $results_hashref, $facets_loop ) = |
348 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
348 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
349 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Efectos del ambiente/ && |
349 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && |
350 |
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' && |
350 |
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' && |
351 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->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/ |
352 |
, "Simple relevance sorting in getRecords matches old behavior"); |
352 |
, "Simple relevance sorting in getRecords matches old behavior"); |
353 |
|
353 |
|
354 |
( undef, $results_hashref, $facets_loop ) = |
354 |
( undef, $results_hashref, $facets_loop ) = |
355 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
355 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
356 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/la enfermedad laboral\^ies$/ && |
356 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && |
357 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[6])->title_proper() =~ m/^Indicadores de resultados identificados/ && |
357 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
358 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'World health statistics 2009^ien' |
358 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' |
359 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
359 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
360 |
|
360 |
|
361 |
( undef, $results_hashref, $facets_loop ) = |
361 |
( undef, $results_hashref, $facets_loop ) = |
362 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
362 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
363 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'World health statistics 2009^ien' && |
363 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
364 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[12])->title_proper() =~ m/^Indicadores de resultados identificados/ && |
364 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
365 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/la enfermedad laboral\^ies$/ |
365 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ |
366 |
, "Simple descending author sorting in getRecords matches old behavior"); |
366 |
, "Simple descending author sorting in getRecords matches old behavior"); |
367 |
|
367 |
|
368 |
( undef, $results_hashref, $facets_loop ) = |
368 |
( undef, $results_hashref, $facets_loop ) = |
369 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
369 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
370 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() eq 'Manual de higiene industrial^ies' && |
370 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && |
371 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && |
371 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && |
372 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() =~ m/^Indicadores de resultados identificados/ |
372 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
373 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
373 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
374 |
|
374 |
|
375 |
( undef, $results_hashref, $facets_loop ) = |
375 |
( undef, $results_hashref, $facets_loop ) = |
376 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
376 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
377 |
ok(MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0])->title_proper() =~ m/^Estado de salud/ && |
377 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && |
378 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[7])->title_proper() eq 'World health statistics 2009^ien' && |
378 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
379 |
MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[18])->title_proper() eq 'Manual de higiene industrial^ies' |
379 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' |
380 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
380 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
381 |
|
381 |
TODO: { |
|
|
382 |
local $TODO = "Switch relevance search to MARCXML too"; |
382 |
( undef, $results_hashref, $facets_loop ) = |
383 |
( undef, $results_hashref, $facets_loop ) = |
383 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
384 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
384 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
385 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
385 |
is($record->title_proper(), 'books', "Scan returned requested item"); |
386 |
is($record->title_proper(), 'books', "Scan returned requested item"); |
386 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
387 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
387 |
|
|
|
388 |
# Time to test buildQuery and searchResults too. |
388 |
# Time to test buildQuery and searchResults too. |
389 |
|
389 |
} |
390 |
my ( $query, $simple_query, $query_cgi, |
390 |
my ( $query, $simple_query, $query_cgi, |
391 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
391 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
392 |
$stopwords_removed, $query_type ); |
392 |
$stopwords_removed, $query_type ); |
Lines 526-535
sub run_marc21_search_tests {
Link Here
|
526 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
526 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
527 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
527 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
528 |
if ($indexing_mode eq 'grs1') { |
528 |
if ($indexing_mode eq 'grs1') { |
529 |
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"); |
529 |
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"); |
530 |
} else { |
530 |
} else { |
531 |
local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; |
531 |
local $TODO = "Query weighting does not behave exactly the same in DOM vs. GRS"; |
532 |
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"); |
532 |
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"); |
533 |
} |
533 |
} |
534 |
|
534 |
|
535 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; |
535 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryRemoveStopwords = 0; |
536 |
- |
|
|