View | Details | Raw Unified | Return to bug 22903
Collapse All | Expand All

(-)a/t/db_dependent/Search.t (-42 / +41 lines)
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 500-506 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
500
    $query_desc, $limit, $limit_cgi, $limit_desc,
500
    $query_desc, $limit, $limit_cgi, $limit_desc,
501
    $query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'available' ], [], 0, 'en');
501
    $query_type ) = buildQuery([], [ '' ], [ 'kw' ], [ 'available' ], [], 0, 'en');
502
502
503
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
503
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
504
    is($results_hashref->{biblioserver}->{hits}, 26, "getRecords generated availability-limited search matched right number of records");
504
    is($results_hashref->{biblioserver}->{hits}, 26, "getRecords generated availability-limited search matched right number of records");
505
505
506
    @newresults = searchResults({'interface'=>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0,
506
    @newresults = searchResults({'interface'=>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0,
Lines 516-543 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
516
    $query_desc, $limit, $limit_cgi, $limit_desc,
516
    $query_desc, $limit, $limit_cgi, $limit_desc,
517
    $query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en');
517
    $query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en');
518
518
519
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
519
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
520
    is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records");
520
    is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records");
521
521
522
    ( $error, $query, $simple_query, $query_cgi,
522
    ( $error, $query, $simple_query, $query_cgi,
523
    $query_desc, $limit, $limit_cgi, $limit_desc,
523
    $query_desc, $limit, $limit_cgi, $limit_desc,
524
    $query_type ) = buildQuery([], [ 'pqf=@attr 1=1016 "Lessig"' ], [], [], [], 0, 'en');
524
    $query_type ) = buildQuery([], [ 'pqf=@attr 1=1016 "Lessig"' ], [], [], [], 0, 'en');
525
525
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,\%branches,\%itemtypes,$query_type,0);
527
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords PQF author search for Lessig returned proper number of matches");
527
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords PQF author search for Lessig returned proper number of matches");
528
528
529
    ( $error, $query, $simple_query, $query_cgi,
529
    ( $error, $query, $simple_query, $query_cgi,
530
    $query_desc, $limit, $limit_cgi, $limit_desc,
530
    $query_desc, $limit, $limit_cgi, $limit_desc,
531
    $query_type ) = buildQuery([], [ 'ccl=au:Lessig' ], [], [], [], 0, 'en');
531
    $query_type ) = buildQuery([], [ 'ccl=au:Lessig' ], [], [], [], 0, 'en');
532
532
533
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
533
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
534
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CCL author search for Lessig returned proper number of matches");
534
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CCL author search for Lessig returned proper number of matches");
535
535
536
    ( $error, $query, $simple_query, $query_cgi,
536
    ( $error, $query, $simple_query, $query_cgi,
537
    $query_desc, $limit, $limit_cgi, $limit_desc,
537
    $query_desc, $limit, $limit_cgi, $limit_desc,
538
    $query_type ) = buildQuery([], [ 'cql=dc.author any lessig' ], [], [], [], 0, 'en');
538
    $query_type ) = buildQuery([], [ 'cql=dc.author any lessig' ], [], [], [], 0, 'en');
539
539
540
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
540
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
541
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches");
541
    is($results_hashref->{biblioserver}->{hits}, 4, "getRecords CQL author search for Lessig returned proper number of matches");
542
542
543
    $QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0;
543
    $QueryStemming = $QueryAutoTruncate = $QueryFuzzy = 0;
Lines 546-552 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
546
    $query_desc, $limit, $limit_cgi, $limit_desc,
546
    $query_desc, $limit, $limit_cgi, $limit_desc,
547
    $query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en');
547
    $query_type ) = buildQuery([], [ 'salud' ], [ 'kw' ], [], [], 0, 'en');
548
548
549
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
549
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
550
    is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results");
550
    is($results_hashref->{biblioserver}->{hits}, 19, "Weighted query returned correct number of results");
551
    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");
551
    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");
552
552
Lines 556-569 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
556
    $query_desc, $limit, $limit_cgi, $limit_desc,
556
    $query_desc, $limit, $limit_cgi, $limit_desc,
557
    $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en');
557
    $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en');
558
558
559
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
559
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
560
    is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic' returns matches  with automatic truncation on");
560
    is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic' returns matches  with automatic truncation on");
561
561
562
    ( $error, $query, $simple_query, $query_cgi,
562
    ( $error, $query, $simple_query, $query_cgi,
563
    $query_desc, $limit, $limit_cgi, $limit_desc,
563
    $query_desc, $limit, $limit_cgi, $limit_desc,
564
    $query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en');
564
    $query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en');
565
565
566
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
566
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
567
    is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on");
567
    is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation on");
568
568
569
    $QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0;
569
    $QueryStemming = $QueryFuzzy = $QueryAutoTruncate = 0;
Lines 571-583 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
571
    ( $error, $query, $simple_query, $query_cgi,
571
    ( $error, $query, $simple_query, $query_cgi,
572
    $query_desc, $limit, $limit_cgi, $limit_desc,
572
    $query_desc, $limit, $limit_cgi, $limit_desc,
573
    $query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en');
573
    $query_type ) = buildQuery([], [ 'web application' ], [ 'kw' ], [], [], 0, 'en');
574
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
574
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
575
    is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on");
575
    is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web application' returns one hit with QueryWeightFields on");
576
576
577
    ( $error, $query, $simple_query, $query_cgi,
577
    ( $error, $query, $simple_query, $query_cgi,
578
    $query_desc, $limit, $limit_cgi, $limit_desc,
578
    $query_desc, $limit, $limit_cgi, $limit_desc,
579
    $query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en');
579
    $query_type ) = buildQuery([], [ 'web "application' ], [ 'kw' ], [], [], 0, 'en');
580
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
580
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
581
    is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)");
581
    is($results_hashref->{biblioserver}->{hits}, 1, "Search for 'web \"application' returns one hit with QueryWeightFields on (bug 7518)");
582
582
583
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0;
583
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0;
Lines 585-598 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
585
    $query_desc, $limit, $limit_cgi, $limit_desc,
585
    $query_desc, $limit, $limit_cgi, $limit_desc,
586
    $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en');
586
    $query_type ) = buildQuery([], [ 'medic' ], [ 'kw' ], [], [], 0, 'en');
587
587
588
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
588
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
589
    is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'medic' returns no matches with automatic truncation off");
589
    is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'medic' returns no matches with automatic truncation off");
590
590
591
    ( $error, $query, $simple_query, $query_cgi,
591
    ( $error, $query, $simple_query, $query_cgi,
592
    $query_desc, $limit, $limit_cgi, $limit_desc,
592
    $query_desc, $limit, $limit_cgi, $limit_desc,
593
    $query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en');
593
    $query_type ) = buildQuery([], [ 'medic*' ], [ 'kw' ], [], [], 0, 'en');
594
594
595
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
595
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
596
    is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off");
596
    is($results_hashref->{biblioserver}->{hits}, 5, "Search for 'medic*' returns matches with automatic truncation off");
597
597
598
    $QueryStemming = $QueryWeightFields = 1;
598
    $QueryStemming = $QueryWeightFields = 1;
Lines 601-607 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
601
    $query_desc, $limit, $limit_cgi, $limit_desc,
601
    $query_desc, $limit, $limit_cgi, $limit_desc,
602
    $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en');
602
    $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en');
603
603
604
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
604
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
605
    is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on");
605
    is($results_hashref->{biblioserver}->{hits}, 7, "Search for 'pressed' returns matches when stemming (and query weighting) is on");
606
606
607
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0;
607
    $QueryStemming = $QueryWeightFields = $QueryFuzzy = $QueryAutoTruncate = 0;
Lines 609-615 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
609
    $query_desc, $limit, $limit_cgi, $limit_desc,
609
    $query_desc, $limit, $limit_cgi, $limit_desc,
610
    $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en');
610
    $query_type ) = buildQuery([], [ 'pressed' ], [ 'kw' ], [], [], 0, 'en');
611
611
612
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
612
    ($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
613
    is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'pressed' returns no matches when stemming is off");
613
    is($results_hashref->{biblioserver}->{hits}, undef, "Search for 'pressed' returns no matches when stemming is off");
614
614
615
    ( $error, $query, $simple_query, $query_cgi,
615
    ( $error, $query, $simple_query, $query_cgi,
Lines 631-646 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
631
    isnt($error, undef, "SimpleSearch returns an error when passed gibberish");
631
    isnt($error, undef, "SimpleSearch returns an error when passed gibberish");
632
632
633
    warning_like {( undef, $results_hashref, $facets_loop ) =
633
    warning_like {( undef, $results_hashref, $facets_loop ) =
634
        getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'nonsense', undef) }
634
        getRecords('kw:book', 'book', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'nonsense', undef) }
635
        qr/Unknown query_type/, "getRecords warns about unknown query type";
635
        qr/Unknown query_type/, "getRecords warns about unknown query type";
636
636
637
    warning_like {( undef, $results_hashref, $facets_loop ) =
637
    warning_like {( undef, $results_hashref, $facets_loop ) =
638
        getRecords('pqf=@attr 1=4 "title"', 'pqf=@attr 1=4 "title"', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, '', undef) }
638
        getRecords('pqf=@attr 1=4 "title"', 'pqf=@attr 1=4 "title"', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, '', undef) }
639
        qr/WARNING: query problem/, "getRecords warns when query type is not specified for non-CCL query";
639
        qr/WARNING: query problem/, "getRecords warns when query type is not specified for non-CCL query";
640
640
641
    # Let's just test a few other bits and bobs, just for fun
641
    # Let's just test a few other bits and bobs, just for fun
642
642
643
    ($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);
643
    ($error, $results_hashref, $facets_loop) = getRecords("Godzina pąsowej róży","Godzina pąsowej róży",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
644
    @newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0,
644
    @newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0,
645
        $results_hashref->{'biblioserver'}->{"RECORDS"});
645
        $results_hashref->{'biblioserver'}->{"RECORDS"});
646
    is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly');
646
    is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly');
Lines 659-672 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
659
        }
659
        }
660
    });
660
    });
661
661
662
    ($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0);
662
    ($error, $results_hashref, $facets_loop) = getRecords("TEST12121212","TEST12121212",[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0);
663
    @newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0,
663
    @newresults = searchResults({'interface'=>'intranet'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0,
664
        $results_hashref->{'biblioserver'}->{"RECORDS"});
664
        $results_hashref->{'biblioserver'}->{"RECORDS"});
665
    ok(!exists($newresults[0]->{norequests}), 'presence of a transit does not block hold request action (bug 10741)');
665
    ok(!exists($newresults[0]->{norequests}), 'presence of a transit does not block hold request action (bug 10741)');
666
666
667
    ## Regression test for bug 10684
667
    ## Regression test for bug 10684
668
    ( undef, $results_hashref, $facets_loop ) =
668
    ( undef, $results_hashref, $facets_loop ) =
669
        getRecords('ti:punctuation', 'punctuation', [], [ 'biblioserver' ], '19', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
669
        getRecords('ti:punctuation', 'punctuation', [], [ 'biblioserver' ], '19', 0, \%branches, \%itemtypes, 'ccl', undef);
670
    is($results_hashref->{biblioserver}->{hits}, 1, "search for ti:punctuation returned expected number of records");
670
    is($results_hashref->{biblioserver}->{hits}, 1, "search for ti:punctuation returned expected number of records");
671
    warning_like { @newresults = searchResults({'intranet' => 'intranet'}, $query_desc,
671
    warning_like { @newresults = searchResults({'intranet' => 'intranet'}, $query_desc,
672
                    $results_hashref->{'biblioserver'}->{'hits'}, 20, 0, 0,
672
                    $results_hashref->{'biblioserver'}->{'hits'}, 20, 0, 0,
Lines 814-820 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
814
814
815
    # retrieve records that are larger than the MARC limit of 99,999 octets
815
    # retrieve records that are larger than the MARC limit of 99,999 octets
816
    ( undef, $results_hashref, $facets_loop ) =
816
    ( undef, $results_hashref, $facets_loop ) =
817
        getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef);
817
        getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef);
818
    is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)");
818
    is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)");
819
    @newresults = searchResults({'interface' =>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0,
819
    @newresults = searchResults({'interface' =>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0,
820
        $results_hashref->{'biblioserver'}->{"RECORDS"});
820
        $results_hashref->{'biblioserver'}->{"RECORDS"});
Lines 831-837 ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],' Link Here
831
    # verify that we don't attempt to sort if no results were returned
831
    # verify that we don't attempt to sort if no results were returned
832
    # because of a query error
832
    # because of a query error
833
    warning_like {( undef, $results_hashref, $facets_loop ) =
833
    warning_like {( undef, $results_hashref, $facets_loop ) =
834
        getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef)
834
        getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef)
835
    } qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)';
835
    } qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)';
836
    
836
    
837
    # Test facet calculation
837
    # Test facet calculation
838
- 

Return to bug 22903