|
Lines 485-502
sub getRecords {
Link Here
|
| 485 |
$tmprecord->append_fields($tmptitle); |
485 |
$tmprecord->append_fields($tmptitle); |
| 486 |
$tmprecord->append_fields($tmpauthor); |
486 |
$tmprecord->append_fields($tmpauthor); |
| 487 |
} |
487 |
} |
| 488 |
$results_hash->{'RECORDS'}[$j] = |
488 |
$results_hash->{'RECORDS'}[$j] = $tmprecord; |
| 489 |
$tmprecord->as_usmarc(); |
|
|
| 490 |
} |
489 |
} |
| 491 |
|
490 |
|
| 492 |
# not an index scan |
491 |
# not an index scan |
| 493 |
else { |
492 |
else { |
| 494 |
$record = $results[ $i - 1 ]->record($j)->raw(); |
493 |
$record = new_record_from_zebra ( |
| 495 |
# warn "RECORD $j:".$record; |
494 |
'biblioserver', |
|
|
495 |
$results[ $i - 1 ]->record($j)->raw() |
| 496 |
); |
| 497 |
|
| 498 |
if ( ! defined $record ) { |
| 499 |
warn "ERROR DECODING RECORD - $@: " . |
| 500 |
$results[ $i - 1 ]->record($j)->raw(); |
| 501 |
next; |
| 502 |
} |
| 503 |
|
| 496 |
$results_hash->{'RECORDS'}[$j] = $record; |
504 |
$results_hash->{'RECORDS'}[$j] = $record; |
| 497 |
} |
505 |
} |
| 498 |
|
506 |
|
| 499 |
} |
507 |
} |
|
|
508 |
|
| 500 |
$results_hashref->{ $servers[ $i - 1 ] } = $results_hash; |
509 |
$results_hashref->{ $servers[ $i - 1 ] } = $results_hash; |
| 501 |
|
510 |
|
| 502 |
# Fill the facets while we're looping, but only for the biblioserver and not for a scan |
511 |
# Fill the facets while we're looping, but only for the biblioserver and not for a scan |
|
Lines 507-522
sub getRecords {
Link Here
|
| 507 |
for my $facet (@$facets) { |
516 |
for my $facet (@$facets) { |
| 508 |
for ( my $j = 0 ; $j < $jmax ; $j++ ) { |
517 |
for ( my $j = 0 ; $j < $jmax ; $j++ ) { |
| 509 |
|
518 |
|
| 510 |
my $marc_record = new_record_from_zebra ( |
519 |
my $marc_record = |
| 511 |
'biblioserver', |
520 |
$results_hashref->{ $servers[ $i - 1 ] }->{'RECORDS'}[$j]; |
| 512 |
$results[ $i - 1 ]->record($j)->raw() |
|
|
| 513 |
); |
| 514 |
|
| 515 |
if ( ! defined $marc_record ) { |
| 516 |
warn "ERROR DECODING RECORD - $@: " . |
| 517 |
$results[ $i - 1 ]->record($j)->raw(); |
| 518 |
next; |
| 519 |
} |
| 520 |
|
521 |
|
| 521 |
my @used_datas = (); |
522 |
my @used_datas = (); |
| 522 |
|
523 |
|
|
Lines 528-534
sub getRecords {
Link Here
|
| 528 |
# Removed when as_string fixed |
529 |
# Removed when as_string fixed |
| 529 |
my @subfields = $subfield_letters =~ /./sg; |
530 |
my @subfields = $subfield_letters =~ /./sg; |
| 530 |
|
531 |
|
| 531 |
my @fields = $marc_record->field($tag_num); |
532 |
# Check $tag_num is a valid field for $marc_record |
|
|
533 |
my @fields = eval { $marc_record->field($tag_num) }; |
| 532 |
foreach my $field (@fields) { |
534 |
foreach my $field (@fields) { |
| 533 |
my $data = $field->as_string( $subfield_letters, $facet->{sep} ); |
535 |
my $data = $field->as_string( $subfield_letters, $facet->{sep} ); |
| 534 |
|
536 |
|
|
Lines 1715-1736
sub searchResults {
Link Here
|
| 1715 |
# loop through all of the records we've retrieved |
1717 |
# loop through all of the records we've retrieved |
| 1716 |
for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { |
1718 |
for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { |
| 1717 |
|
1719 |
|
| 1718 |
my $marcrecord; |
1720 |
my $marcrecord = $marcresults->[$i]; |
| 1719 |
if ($scan) { |
|
|
| 1720 |
# For Scan searches we built USMARC data |
| 1721 |
$marcrecord = MARC::Record->new_from_usmarc( $marcresults->[$i]); |
| 1722 |
} else { |
| 1723 |
# Normal search, render from Zebra's output |
| 1724 |
$marcrecord = new_record_from_zebra( |
| 1725 |
'biblioserver', |
| 1726 |
$marcresults->[$i] |
| 1727 |
); |
| 1728 |
|
| 1729 |
if ( ! defined $marcrecord ) { |
| 1730 |
warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i]; |
| 1731 |
next; |
| 1732 |
} |
| 1733 |
} |
| 1734 |
|
1721 |
|
| 1735 |
my $fw = $scan |
1722 |
my $fw = $scan |
| 1736 |
? undef |
1723 |
? undef |
| 1737 |
- |
|
|