|
Lines 22-28
use Modern::Perl;
Link Here
|
| 22 |
use MARC::Field; |
22 |
use MARC::Field; |
| 23 |
use C4::Context; |
23 |
use C4::Context; |
| 24 |
use Module::Load qw( load ); |
24 |
use Module::Load qw( load ); |
| 25 |
|
25 |
use List::Util qw( none ); |
| 26 |
|
26 |
|
| 27 |
=head1 NAME |
27 |
=head1 NAME |
| 28 |
|
28 |
|
|
Lines 239-253
sub _search {
Link Here
|
| 239 |
my ( $matched_auths, $total ) = $searcher->search_auth_compat( $search_query, 0, 20, $skipmetadata ); |
239 |
my ( $matched_auths, $total ) = $searcher->search_auth_compat( $search_query, 0, 20, $skipmetadata ); |
| 240 |
# Some auth records may not contain the 040$f to specify their source |
240 |
# Some auth records may not contain the 040$f to specify their source |
| 241 |
# This is legal, so we do a fallback search |
241 |
# This is legal, so we do a fallback search |
| 242 |
if( !$total && $thesaurus && !( grep /$thesaurus/,('lcsh','lcac','mesh','nal','notspecified','cash','rvm','sears','aat') ) ){ |
242 |
if ( |
|
|
243 |
!$total |
| 244 |
&& $thesaurus |
| 245 |
&& none { $_ eq $thesaurus } ( |
| 246 |
'lcsh', 'lcac', 'mesh', 'nal', |
| 247 |
'notspecified', 'cash', 'rvm', 'sears', |
| 248 |
'aat' |
| 249 |
) |
| 250 |
) |
| 251 |
{ |
| 243 |
pop @value; |
252 |
pop @value; |
| 244 |
push @value, 'notdefined'; |
253 |
push @value, 'notdefined'; |
| 245 |
$search_query = $builder->build_authorities_query_compat( |
254 |
$search_query = |
| 246 |
\@marclist, \@and_or, \@excluding, \@operator, |
255 |
$builder->build_authorities_query_compat( \@marclist, \@and_or, |
| 247 |
\@value, $self->{'auth_type'}, |
256 |
\@excluding, \@operator, \@value, $self->{'auth_type'}, |
| 248 |
'AuthidAsc' |
257 |
'AuthidAsc' ); |
| 249 |
); |
258 |
( $matched_auths, $total ) = |
| 250 |
( $matched_auths, $total ) = $searcher->search_auth_compat( $search_query, 0, 20, $skipmetadata ); |
259 |
$searcher->search_auth_compat( $search_query, 0, 20, $skipmetadata ); |
| 251 |
} |
260 |
} |
| 252 |
return ( $matched_auths, $total ); |
261 |
return ( $matched_auths, $total ); |
| 253 |
|
262 |
|
| 254 |
- |
|
|