|
Lines 347-358
sub run_marc21_search_tests {
Link Here
|
| 347 |
my $results_hashref; |
347 |
my $results_hashref; |
| 348 |
my $facets_loop; |
348 |
my $facets_loop; |
| 349 |
( undef, $results_hashref, $facets_loop ) = |
349 |
( undef, $results_hashref, $facets_loop ) = |
| 350 |
getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
350 |
getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 351 |
is($results_hashref->{biblioserver}->{hits}, 101, "getRecords keyword search for 'book' matched right number of records"); |
351 |
is($results_hashref->{biblioserver}->{hits}, 101, "getRecords keyword search for 'book' matched right number of records"); |
| 352 |
is(scalar @{$results_hashref->{biblioserver}->{RECORDS}}, 19, "getRecords returned requested number of records"); |
352 |
is(scalar @{$results_hashref->{biblioserver}->{RECORDS}}, 19, "getRecords returned requested number of records"); |
| 353 |
my $record5 = $results_hashref->{biblioserver}->{RECORDS}->[5]; |
353 |
my $record5 = $results_hashref->{biblioserver}->{RECORDS}->[5]; |
| 354 |
( undef, $results_hashref, $facets_loop ) = |
354 |
( undef, $results_hashref, $facets_loop ) = |
| 355 |
getRecords('kw:book', 'book', [], [ 'biblioserver' ], '20', 5, undef, \%branches, \%itemtypes, 'ccl', undef); |
355 |
getRecords('kw:book', 'book', [], [ 'biblioserver' ], '20', 5, \%branches, \%itemtypes, 'ccl', undef); |
| 356 |
ok(!defined $results_hashref->{biblioserver}->{RECORDS}->[0] && |
356 |
ok(!defined $results_hashref->{biblioserver}->{RECORDS}->[0] && |
| 357 |
!defined $results_hashref->{biblioserver}->{RECORDS}->[1] && |
357 |
!defined $results_hashref->{biblioserver}->{RECORDS}->[1] && |
| 358 |
!defined $results_hashref->{biblioserver}->{RECORDS}->[2] && |
358 |
!defined $results_hashref->{biblioserver}->{RECORDS}->[2] && |
|
Lines 361-410
sub run_marc21_search_tests {
Link Here
|
| 361 |
$results_hashref->{biblioserver}->{RECORDS}->[5] eq $record5, "getRecords cursor works"); |
361 |
$results_hashref->{biblioserver}->{RECORDS}->[5] eq $record5, "getRecords cursor works"); |
| 362 |
|
362 |
|
| 363 |
( undef, $results_hashref, $facets_loop ) = |
363 |
( undef, $results_hashref, $facets_loop ) = |
| 364 |
getRecords('ti:book', 'ti:book', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
364 |
getRecords('ti:book', 'ti:book', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 365 |
is($results_hashref->{biblioserver}->{hits}, 11, "getRecords title search for 'book' matched right number of records"); |
365 |
is($results_hashref->{biblioserver}->{hits}, 11, "getRecords title search for 'book' matched right number of records"); |
| 366 |
|
366 |
|
| 367 |
( undef, $results_hashref, $facets_loop ) = |
367 |
( undef, $results_hashref, $facets_loop ) = |
| 368 |
getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
368 |
getRecords('au:Lessig', 'au:Lessig', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 369 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); |
369 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords title search for 'Australia' matched right number of records"); |
| 370 |
|
370 |
|
| 371 |
( undef, $results_hashref, $facets_loop ) = |
371 |
( undef, $results_hashref, $facets_loop ) = |
| 372 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
372 |
getRecords('salud', 'salud', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 373 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && |
373 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Efectos del ambiente/ && |
| 374 |
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' && |
374 |
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' && |
| 375 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
375 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
| 376 |
, "Simple relevance sorting in getRecords matches old behavior"); |
376 |
, "Simple relevance sorting in getRecords matches old behavior"); |
| 377 |
|
377 |
|
| 378 |
( undef, $results_hashref, $facets_loop ) = |
378 |
( undef, $results_hashref, $facets_loop ) = |
| 379 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
379 |
getRecords('salud', 'salud', [ 'author_az' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 380 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && |
380 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ && |
| 381 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
381 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[6],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
| 382 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' |
382 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' |
| 383 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
383 |
, "Simple ascending author sorting in getRecords matches old behavior"); |
| 384 |
|
384 |
|
| 385 |
( undef, $results_hashref, $facets_loop ) = |
385 |
( undef, $results_hashref, $facets_loop ) = |
| 386 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
386 |
getRecords('salud', 'salud', [ 'author_za' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 387 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
387 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
| 388 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
388 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[12],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ && |
| 389 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ |
389 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/la enfermedad laboral\^ies$/ |
| 390 |
, "Simple descending author sorting in getRecords matches old behavior"); |
390 |
, "Simple descending author sorting in getRecords matches old behavior"); |
| 391 |
|
391 |
|
| 392 |
( undef, $results_hashref, $facets_loop ) = |
392 |
( undef, $results_hashref, $facets_loop ) = |
| 393 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
393 |
getRecords('salud', 'salud', [ 'pubdate_asc' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 394 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && |
394 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' && |
| 395 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && |
395 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() =~ m/seguridad e higiene del trabajo\^ies$/ && |
| 396 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
396 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() =~ m/^Indicadores de resultados identificados/ |
| 397 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
397 |
, "Simple ascending publication date sorting in getRecords matches old behavior"); |
| 398 |
|
398 |
|
| 399 |
( undef, $results_hashref, $facets_loop ) = |
399 |
( undef, $results_hashref, $facets_loop ) = |
| 400 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
400 |
getRecords('salud', 'salud', [ 'pubdate_dsc' ], [ 'biblioserver' ], '38', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 401 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && |
401 |
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'UTF-8')->title_proper() =~ m/^Estado de salud/ && |
| 402 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
402 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[7],'UTF-8')->title_proper() eq 'World health statistics 2009^ien' && |
| 403 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' |
403 |
MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[18],'UTF-8')->title_proper() eq 'Manual de higiene industrial^ies' |
| 404 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
404 |
, "Simple descending publication date sorting in getRecords matches old behavior"); |
| 405 |
|
405 |
|
| 406 |
( undef, $results_hashref, $facets_loop ) = |
406 |
( undef, $results_hashref, $facets_loop ) = |
| 407 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, undef, 1); |
407 |
getRecords('books', 'books', [ 'relevance' ], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, undef, 1); |
| 408 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
408 |
$record = MARC::Record::new_from_usmarc($results_hashref->{biblioserver}->{RECORDS}->[0]); |
| 409 |
is($record->title_proper(), 'Books', "Scan returned requested item"); |
409 |
is($record->title_proper(), 'Books', "Scan returned requested item"); |
| 410 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
410 |
is($record->subfield('100', 'a'), 2, "Scan returned correct number of records matching term"); |
|
Lines 418-424
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 418 |
$query_type ) = buildQuery([], [ 'salud' ], [], [], [], 0, 'en'); |
418 |
$query_type ) = buildQuery([], [ 'salud' ], [], [], [], 0, 'en'); |
| 419 |
like($query, qr/kw\W.*salud/, "Built CCL keyword query"); |
419 |
like($query, qr/kw\W.*salud/, "Built CCL keyword query"); |
| 420 |
|
420 |
|
| 421 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
421 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 422 |
is($results_hashref->{biblioserver}->{hits}, 19, "getRecords generated keyword search for 'salud' matched right number of records"); |
422 |
is($results_hashref->{biblioserver}->{hits}, 19, "getRecords generated keyword search for 'salud' matched right number of records"); |
| 423 |
|
423 |
|
| 424 |
my @newresults = searchResults({'interface' => 'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 18, 0, 0, |
424 |
my @newresults = searchResults({'interface' => 'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 18, 0, 0, |
|
Lines 430-436
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 430 |
$query_type ) = buildQuery([ 'and' ], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); |
430 |
$query_type ) = buildQuery([ 'and' ], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); |
| 431 |
like($query, qr/kw\W.*salud\W.*and.*kw\W.*higiene/, "Built composed explicit-and CCL keyword query"); |
431 |
like($query, qr/kw\W.*salud\W.*and.*kw\W.*higiene/, "Built composed explicit-and CCL keyword query"); |
| 432 |
|
432 |
|
| 433 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
433 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 434 |
is($results_hashref->{biblioserver}->{hits}, 3, "getRecords generated composed keyword search for 'salud' explicit-and 'higiene' matched right number of records"); |
434 |
is($results_hashref->{biblioserver}->{hits}, 3, "getRecords generated composed keyword search for 'salud' explicit-and 'higiene' matched right number of records"); |
| 435 |
|
435 |
|
| 436 |
( $error, $query, $simple_query, $query_cgi, |
436 |
( $error, $query, $simple_query, $query_cgi, |
|
Lines 438-444
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 438 |
$query_type ) = buildQuery([ 'or' ], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); |
438 |
$query_type ) = buildQuery([ 'or' ], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); |
| 439 |
like($query, qr/kw\W.*salud\W.*or.*kw\W.*higiene/, "Built composed explicit-or CCL keyword query"); |
439 |
like($query, qr/kw\W.*salud\W.*or.*kw\W.*higiene/, "Built composed explicit-or CCL keyword query"); |
| 440 |
|
440 |
|
| 441 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
441 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 442 |
is($results_hashref->{biblioserver}->{hits}, 20, "getRecords generated composed keyword search for 'salud' explicit-or 'higiene' matched right number of records"); |
442 |
is($results_hashref->{biblioserver}->{hits}, 20, "getRecords generated composed keyword search for 'salud' explicit-or 'higiene' matched right number of records"); |
| 443 |
|
443 |
|
| 444 |
( $error, $query, $simple_query, $query_cgi, |
444 |
( $error, $query, $simple_query, $query_cgi, |
|
Lines 446-452
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 446 |
$query_type ) = buildQuery([], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); |
446 |
$query_type ) = buildQuery([], [ 'salud', 'higiene' ], [], [], [], 0, 'en'); |
| 447 |
like($query, qr/kw\W.*salud\W.*and.*kw\W.*higiene/, "Built composed implicit-and CCL keyword query"); |
447 |
like($query, qr/kw\W.*salud\W.*and.*kw\W.*higiene/, "Built composed implicit-and CCL keyword query"); |
| 448 |
|
448 |
|
| 449 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
449 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 450 |
is($results_hashref->{biblioserver}->{hits}, 3, "getRecords generated composed keyword search for 'salud' implicit-and 'higiene' matched right number of records"); |
450 |
is($results_hashref->{biblioserver}->{hits}, 3, "getRecords generated composed keyword search for 'salud' implicit-and 'higiene' matched right number of records"); |
| 451 |
|
451 |
|
| 452 |
( $error, $query, $simple_query, $query_cgi, |
452 |
( $error, $query, $simple_query, $query_cgi, |
|
Lines 455-461
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 455 |
like($query, qr/kw\W.*salud\W*and\W*su-to\W.*Laboratorios/, "Faceted query generated correctly"); |
455 |
like($query, qr/kw\W.*salud\W*and\W*su-to\W.*Laboratorios/, "Faceted query generated correctly"); |
| 456 |
unlike($query_desc, qr/Laboratorios/, "Facets not included in query description"); |
456 |
unlike($query_desc, qr/Laboratorios/, "Facets not included in query description"); |
| 457 |
|
457 |
|
| 458 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
458 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 459 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated faceted search matched right number of records"); |
459 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated faceted search matched right number of records"); |
| 460 |
|
460 |
|
| 461 |
|
461 |
|
|
Lines 463-469
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 463 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
463 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 464 |
$query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'mc-itype:MP', 'mc-itype:MU' ], [], 0, 'en'); |
464 |
$query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'mc-itype:MP', 'mc-itype:MU' ], [], 0, 'en'); |
| 465 |
|
465 |
|
| 466 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
466 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 467 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated mc-faceted search matched right number of records"); |
467 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated mc-faceted search matched right number of records"); |
| 468 |
|
468 |
|
| 469 |
|
469 |
|
|
Lines 471-483
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 471 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
471 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 472 |
$query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'mc-loc:GEN', 'branch:FFL' ], [], 0, 'en'); |
472 |
$query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'mc-loc:GEN', 'branch:FFL' ], [], 0, 'en'); |
| 473 |
|
473 |
|
| 474 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
474 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 475 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated multi-faceted search matched right number of records"); |
475 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated multi-faceted search matched right number of records"); |
| 476 |
|
476 |
|
| 477 |
( $error, $query, $simple_query, $query_cgi, |
477 |
( $error, $query, $simple_query, $query_cgi, |
| 478 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
478 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 479 |
$query_type ) = buildQuery([], [ 'NEKLS' ], [ 'Code-institution' ], [], [], 0, 'en'); |
479 |
$query_type ) = buildQuery([], [ 'NEKLS' ], [ 'Code-institution' ], [], [], 0, 'en'); |
| 480 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
480 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 481 |
is($results_hashref->{biblioserver}->{hits}, 12, |
481 |
is($results_hashref->{biblioserver}->{hits}, 12, |
| 482 |
'search using index whose name contains "ns" returns expected results (bug 10271)'); |
482 |
'search using index whose name contains "ns" returns expected results (bug 10271)'); |
| 483 |
|
483 |
|
|
Lines 485-496
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 485 |
( $error, $query, $simple_query, $query_cgi, |
485 |
( $error, $query, $simple_query, $query_cgi, |
| 486 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
486 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 487 |
$query_type ) = buildQuery([], [ 'book' ], [ 'kw' ], [], [], 0, 'en'); |
487 |
$query_type ) = buildQuery([], [ 'book' ], [ 'kw' ], [], [], 0, 'en'); |
| 488 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
488 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 489 |
is($results_hashref->{biblioserver}->{hits}, 101, "Search for 'book' with index set to 'kw' returns 101 hits"); |
489 |
is($results_hashref->{biblioserver}->{hits}, 101, "Search for 'book' with index set to 'kw' returns 101 hits"); |
| 490 |
( $error, $query, $simple_query, $query_cgi, |
490 |
( $error, $query, $simple_query, $query_cgi, |
| 491 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
491 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 492 |
$query_type ) = buildQuery([ 'and' ], [ 'book', 'another' ], [ 'kw', 'kw' ], [], [], 0, 'en'); |
492 |
$query_type ) = buildQuery([ 'and' ], [ 'book', 'another' ], [ 'kw', 'kw' ], [], [], 0, 'en'); |
| 493 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
493 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 494 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'kw:book && kw:another' returns 1 hit"); |
494 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'kw:book && kw:another' returns 1 hit"); |
| 495 |
$UseQueryParser = 0; |
495 |
$UseQueryParser = 0; |
| 496 |
|
496 |
|
|
Lines 498-504
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 498 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
498 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 499 |
$query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'available' ], [], 0, 'en'); |
499 |
$query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'available' ], [], 0, 'en'); |
| 500 |
|
500 |
|
| 501 |
($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,\%branches,\%itemtypes,$query_type,0); |
| 502 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated availability-limited search matched right number of records"); |
502 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated availability-limited search matched right number of records"); |
| 503 |
|
503 |
|
| 504 |
@newresults = searchResults({'interface'=>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
504 |
@newresults = searchResults({'interface'=>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
|
Lines 514-541
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 514 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
514 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 515 |
$query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); |
515 |
$query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); |
| 516 |
|
516 |
|
| 517 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
517 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 518 |
is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records"); |
518 |
is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records"); |
| 519 |
|
519 |
|
| 520 |
( $error, $query, $simple_query, $query_cgi, |
520 |
( $error, $query, $simple_query, $query_cgi, |
| 521 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
521 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 522 |
$query_type ) = buildQuery([], [ 'pqf=@attr 1=1016 "Lessig"' ], [], [], [], 0, 'en'); |
522 |
$query_type ) = buildQuery([], [ 'pqf=@attr 1=1016 "Lessig"' ], [], [], [], 0, 'en'); |
| 523 |
|
523 |
|
| 524 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
524 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 525 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords PQF author search for Lessig returned proper number of matches"); |
525 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords PQF author search for Lessig returned proper number of matches"); |
| 526 |
|
526 |
|
| 527 |
( $error, $query, $simple_query, $query_cgi, |
527 |
( $error, $query, $simple_query, $query_cgi, |
| 528 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
528 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 529 |
$query_type ) = buildQuery([], [ 'ccl=au:Lessig' ], [], [], [], 0, 'en'); |
529 |
$query_type ) = buildQuery([], [ 'ccl=au:Lessig' ], [], [], [], 0, 'en'); |
| 530 |
|
530 |
|
| 531 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
531 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 532 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CCL author search for Lessig returned proper number of matches"); |
532 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CCL author search for Lessig returned proper number of matches"); |
| 533 |
|
533 |
|
| 534 |
( $error, $query, $simple_query, $query_cgi, |
534 |
( $error, $query, $simple_query, $query_cgi, |
| 535 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
535 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 536 |
$query_type ) = buildQuery([], [ 'cql=dc.author any lessig' ], [], [], [], 0, 'en'); |
536 |
$query_type ) = buildQuery([], [ 'cql=dc.author any lessig' ], [], [], [], 0, 'en'); |
| 537 |
|
537 |
|
| 538 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
538 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 539 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches"); |
539 |
is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches"); |
| 540 |
|
540 |
|
| 541 |
$QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0; |
541 |
$QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0; |
|
Lines 544-550
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 544 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
544 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 545 |
$query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en'); |
545 |
$query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en'); |
| 546 |
|
546 |
|
| 547 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
547 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 548 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
548 |
is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results"); |
| 549 |
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"); |
549 |
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"); |
| 550 |
|
550 |
|
|
Lines 554-567
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 554 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
554 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 555 |
$query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); |
555 |
$query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); |
| 556 |
|
556 |
|
| 557 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
557 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 558 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic' returns matches with automatic truncation on"); |
558 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic' returns matches with automatic truncation on"); |
| 559 |
|
559 |
|
| 560 |
( $error, $query, $simple_query, $query_cgi, |
560 |
( $error, $query, $simple_query, $query_cgi, |
| 561 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
561 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 562 |
$query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en'); |
562 |
$query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en'); |
| 563 |
|
563 |
|
| 564 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
564 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 565 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on"); |
565 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on"); |
| 566 |
|
566 |
|
| 567 |
$QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; |
567 |
$QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0; |
|
Lines 569-581
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 569 |
( $error, $query, $simple_query, $query_cgi, |
569 |
( $error, $query, $simple_query, $query_cgi, |
| 570 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
570 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 571 |
$query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en'); |
571 |
$query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en'); |
| 572 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
572 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 573 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on"); |
573 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on"); |
| 574 |
|
574 |
|
| 575 |
( $error, $query, $simple_query, $query_cgi, |
575 |
( $error, $query, $simple_query, $query_cgi, |
| 576 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
576 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 577 |
$query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en'); |
577 |
$query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en'); |
| 578 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
578 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 579 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)"); |
579 |
is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)"); |
| 580 |
|
580 |
|
| 581 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; |
581 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; |
|
Lines 583-596
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 583 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
583 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 584 |
$query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); |
584 |
$query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en'); |
| 585 |
|
585 |
|
| 586 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
586 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 587 |
is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'medic' returns no matches with automatic truncation off"); |
587 |
is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'medic' returns no matches with automatic truncation off"); |
| 588 |
|
588 |
|
| 589 |
( $error, $query, $simple_query, $query_cgi, |
589 |
( $error, $query, $simple_query, $query_cgi, |
| 590 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
590 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 591 |
$query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en'); |
591 |
$query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en'); |
| 592 |
|
592 |
|
| 593 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
593 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 594 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off"); |
594 |
is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off"); |
| 595 |
|
595 |
|
| 596 |
$QueryStemming = $QueryWeightFields = 1; |
596 |
$QueryStemming = $QueryWeightFields = 1; |
|
Lines 599-605
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 599 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
599 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 600 |
$query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); |
600 |
$query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); |
| 601 |
|
601 |
|
| 602 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
602 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 603 |
is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on"); |
603 |
is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on"); |
| 604 |
|
604 |
|
| 605 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; |
605 |
$QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0; |
|
Lines 607-613
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 607 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
607 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 608 |
$query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); |
608 |
$query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en'); |
| 609 |
|
609 |
|
| 610 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
610 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 611 |
is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'pressed' returns no matches when stemming is off"); |
611 |
is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'pressed' returns no matches when stemming is off"); |
| 612 |
|
612 |
|
| 613 |
( $error, $query, $simple_query, $query_cgi, |
613 |
( $error, $query, $simple_query, $query_cgi, |
|
Lines 629-644
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 629 |
isnt($error, undef, "SimpleSearch returns an error when passed gibberish"); |
629 |
isnt($error, undef, "SimpleSearch returns an error when passed gibberish"); |
| 630 |
|
630 |
|
| 631 |
warning_like {( undef, $results_hashref, $facets_loop ) = |
631 |
warning_like {( undef, $results_hashref, $facets_loop ) = |
| 632 |
getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'nonsense', undef) } |
632 |
getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'nonsense', undef) } |
| 633 |
qr/Unknown query_type/, "getRecords warns about unknown query type"; |
633 |
qr/Unknown query_type/, "getRecords warns about unknown query type"; |
| 634 |
|
634 |
|
| 635 |
warning_like {( undef, $results_hashref, $facets_loop ) = |
635 |
warning_like {( undef, $results_hashref, $facets_loop ) = |
| 636 |
getRecords('pqf=@attr 1=4 "title"', 'pqf=@attr 1=4 "title"', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, '', undef) } |
636 |
getRecords('pqf=@attr 1=4 "title"', 'pqf=@attr 1=4 "title"', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, '', undef) } |
| 637 |
qr/WARNING: query problem/, "getRecords warns when query type is not specified for non-CCL query"; |
637 |
qr/WARNING: query problem/, "getRecords warns when query type is not specified for non-CCL query"; |
| 638 |
|
638 |
|
| 639 |
# Let's just test a few other bits and bobs, just for fun |
639 |
# Let's just test a few other bits and bobs, just for fun |
| 640 |
|
640 |
|
| 641 |
($error, $results_hashref, $facets_loop) = getRecords("Godzina pąsowej róży","Godzina pąsowej róży",[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
641 |
($error, $results_hashref, $facets_loop) = getRecords("Godzina pąsowej róży","Godzina pąsowej róży",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 642 |
@newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
642 |
@newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
| 643 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
643 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
| 644 |
is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly'); |
644 |
is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly'); |
|
Lines 657-670
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 657 |
} |
657 |
} |
| 658 |
}); |
658 |
}); |
| 659 |
|
659 |
|
| 660 |
($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
660 |
($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 661 |
@newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
661 |
@newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
| 662 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
662 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
| 663 |
ok(!exists($newresults[0]->{norequests}), 'presence of a transit does not block hold request action (bug 10741)'); |
663 |
ok(!exists($newresults[0]->{norequests}), 'presence of a transit does not block hold request action (bug 10741)'); |
| 664 |
|
664 |
|
| 665 |
## Regression test for bug 10684 |
665 |
## Regression test for bug 10684 |
| 666 |
( undef, $results_hashref, $facets_loop ) = |
666 |
( undef, $results_hashref, $facets_loop ) = |
| 667 |
getRecords('ti:punctuation', 'punctuation', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
667 |
getRecords('ti:punctuation', 'punctuation', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 668 |
is($results_hashref->{biblioserver}->{hits}, 1, "search for ti:punctuation returned expected number of records"); |
668 |
is($results_hashref->{biblioserver}->{hits}, 1, "search for ti:punctuation returned expected number of records"); |
| 669 |
warning_like { @newresults = searchResults({'intranet' => 'intranet'}, $query_desc, |
669 |
warning_like { @newresults = searchResults({'intranet' => 'intranet'}, $query_desc, |
| 670 |
$results_hashref->{'biblioserver'}->{'hits'}, 20, 0, 0, |
670 |
$results_hashref->{'biblioserver'}->{'hits'}, 20, 0, 0, |
|
Lines 812-818
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 812 |
|
812 |
|
| 813 |
# retrieve records that are larger than the MARC limit of 99,999 octets |
813 |
# retrieve records that are larger than the MARC limit of 99,999 octets |
| 814 |
( undef, $results_hashref, $facets_loop ) = |
814 |
( undef, $results_hashref, $facets_loop ) = |
| 815 |
getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
815 |
getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 816 |
is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)"); |
816 |
is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)"); |
| 817 |
@newresults = searchResults({'interface' =>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, |
817 |
@newresults = searchResults({'interface' =>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, |
| 818 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
818 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
|
Lines 829-835
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 829 |
# verify that we don't attempt to sort if no results were returned |
829 |
# verify that we don't attempt to sort if no results were returned |
| 830 |
# because of a query error |
830 |
# because of a query error |
| 831 |
warning_like {( undef, $results_hashref, $facets_loop ) = |
831 |
warning_like {( undef, $results_hashref, $facets_loop ) = |
| 832 |
getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef) |
832 |
getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef) |
| 833 |
} qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)'; |
833 |
} qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)'; |
| 834 |
|
834 |
|
| 835 |
# Test facet calculation |
835 |
# Test facet calculation |
|
Lines 860-883
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 860 |
# Test _get_facets_info |
860 |
# Test _get_facets_info |
| 861 |
my $facets_info = C4::Search::_get_facets_info( $facets ); |
861 |
my $facets_info = C4::Search::_get_facets_info( $facets ); |
| 862 |
my $expected_facets_info_marc21 = { |
862 |
my $expected_facets_info_marc21 = { |
| 863 |
'au' => { 'expanded' => undef, |
863 |
'au' => { 'label_value' => "Authors" }, |
| 864 |
'label_value' => "Authors" }, |
864 |
'ccode' => { 'label_value' => "CollectionCodes" }, |
| 865 |
'ccode' => { 'expanded' => undef, |
865 |
'holdingbranch' => { 'label_value' => "HoldingLibrary" }, |
| 866 |
'label_value' => "CollectionCodes" }, |
866 |
'itype' => { 'label_value' => "ItemTypes" }, |
| 867 |
'holdingbranch' => { 'expanded' => undef, |
867 |
'location' => { 'label_value' => "Location" }, |
| 868 |
'label_value' => "HoldingLibrary" }, |
868 |
'se' => { 'label_value' => "Series" }, |
| 869 |
'itype' => { 'expanded' => undef, |
869 |
'su-geo' => { 'label_value' => "Places" }, |
| 870 |
'label_value' => "ItemTypes" }, |
870 |
'su-to' => { 'label_value' => "Topics" }, |
| 871 |
'location' => { 'expanded' => undef, |
871 |
'su-ut' => { 'label_value' => "Titles" } |
| 872 |
'label_value' => "Location" }, |
|
|
| 873 |
'se' => { 'expanded' => undef, |
| 874 |
'label_value' => "Series" }, |
| 875 |
'su-geo' => { 'expanded' => undef, |
| 876 |
'label_value' => "Places" }, |
| 877 |
'su-to' => { 'expanded' => undef, |
| 878 |
'label_value' => "Topics" }, |
| 879 |
'su-ut' => { 'expanded' => undef, |
| 880 |
'label_value' => "Titles" } |
| 881 |
}; |
872 |
}; |
| 882 |
delete $expected_facets_info_marc21->{holdingbranch} |
873 |
delete $expected_facets_info_marc21->{holdingbranch} |
| 883 |
if Koha::Libraries->count == 1; |
874 |
if Koha::Libraries->count == 1; |
|
Lines 959-980
sub run_unimarc_search_tests {
Link Here
|
| 959 |
my $facets = C4::Koha::getFacets(); |
950 |
my $facets = C4::Koha::getFacets(); |
| 960 |
my $facets_info = C4::Search::_get_facets_info( $facets ); |
951 |
my $facets_info = C4::Search::_get_facets_info( $facets ); |
| 961 |
my $expected_facets_info_unimarc = { |
952 |
my $expected_facets_info_unimarc = { |
| 962 |
'au' => { 'expanded' => undef, |
953 |
'au' => { 'label_value' => "Authors" }, |
| 963 |
'label_value' => "Authors" }, |
954 |
'ccode' => { 'label_value' => "CollectionCodes" }, |
| 964 |
'ccode' => { 'expanded' => undef, |
955 |
'holdingbranch' => { 'label_value' => "HoldingLibrary" }, |
| 965 |
'label_value' => "CollectionCodes" }, |
956 |
'location' => { 'label_value' => "Location" }, |
| 966 |
'holdingbranch' => { 'expanded' => undef, |
957 |
'se' => { 'label_value' => "Series" }, |
| 967 |
'label_value' => "HoldingLibrary" }, |
958 |
'su-geo' => { 'label_value' => "Places" }, |
| 968 |
'location' => { 'expanded' => undef, |
959 |
'su-to' => { 'label_value' => "Topics" }, |
| 969 |
'label_value' => "Location" }, |
960 |
'su-ut' => { 'label_value' => "Titles" } |
| 970 |
'se' => { 'expanded' => undef, |
|
|
| 971 |
'label_value' => "Series" }, |
| 972 |
'su-geo' => { 'expanded' => undef, |
| 973 |
'label_value' => "Places" }, |
| 974 |
'su-to' => { 'expanded' => undef, |
| 975 |
'label_value' => "Topics" }, |
| 976 |
'su-ut' => { 'expanded' => undef, |
| 977 |
'label_value' => "Titles" } |
| 978 |
}; |
961 |
}; |
| 979 |
delete $expected_facets_info_unimarc->{holdingbranch} |
962 |
delete $expected_facets_info_unimarc->{holdingbranch} |
| 980 |
if Koha::Libraries->count == 1; |
963 |
if Koha::Libraries->count == 1; |
| 981 |
- |
|
|