}
# Build the badge-ish WITH query
+ # NOBLE changed badge math on SUM line
my $pop_with = <<' WITH';
pop_with AS (
SELECT record,
ARRAY_AGG(badge) AS badges,
- SUM(s.score::NUMERIC*b.weight::NUMERIC)/SUM(b.weight::NUMERIC) AS total_score
+ SUM(s.score::NUMERIC*b.weight::NUMERIC)/(SELECT SUM(badge.weight::NUMERIC) from rating.badge) AS total_score
FROM rating.record_badge_score s
JOIN rating.badge b ON (
b.id = s.badge
# reset prox list after trimming good copies
$prox_list = create_prox_list(
$self, $pu_lib,
- [ grep { $_->status == 0 || $_->status == 7 } @good_copies ],
+ [ grep { $_->status == 0 || $_->status == 7 || $_->status == 107 } @good_copies ],
$hold, $hold_copy_map
);
- $all_copies = [ grep { ''.$_->circ_lib ne $pu_lib && ( $_->status == 0 || $_->status == 7 ) } @good_copies ];
+ $all_copies = [ grep { ''.$_->circ_lib ne $pu_lib && ( $_->status == 0 || $_->status == 7 || $_->status == 107 ) } @good_copies ];
my $min_prox = [ sort {$a<=>$b} keys %$prox_list ]->[0];
my $best;
next;
}
- if ($copy->status->id == 0 || $copy->status->id == 7) {
+ if ($copy->status->id == 0 || $copy->status->id == 7 || $copy->status == 107) {
push @good_resources, $res;
next;
}
my @ns;
my @namev;
if ($nv) {
- $name = "name_kw_tsvector @@ to_tsquery(?)";
+ $name = "name_kw_tsvector @@ to_tsquery('simple', ?)";
# Remove characters that to_tsquery might treat as operators.
# Note using plainto_tsquery to ignore operators won't let us
return $self->load_library if $path =~ m|opac/library|;
return $self->load_rresults if $path =~ m|opac/results|;
+ # NOBLE
+ return $self->load_rresults if $path =~ m|opac/bookbag|;
return $self->load_print_or_email_preview('print') if $path =~ m|opac/record/print_preview|;
return $self->load_print_record if $path =~ m|opac/record/print|;
return $self->load_record if $path =~ m|opac/record/\d|;
}
}
- $quote_it = 0 if ( $base eq 'all' );
+ #$quote_it = 0 if ( $base eq 'all' ); #NOBLE don't quote keyword for ComCat
+ $quote_it = 0 if ( $base eq 'all' || ( $base eq '=' && grep {$qualifier eq $_} qw(eg.keyword eg.title eg.author) ) );
$term = maybeQuote($term) if $quote_it;
} else {