|
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 |
use List::Util qw( none ); |
25 |
use List::Util qw( none first ); |
| 26 |
|
26 |
|
| 27 |
=head1 NAME |
27 |
=head1 NAME |
| 28 |
|
28 |
|
|
Lines 206-211
sub _search {
Link Here
|
| 206 |
push @value, $thesaurus; |
206 |
push @value, $thesaurus; |
| 207 |
} |
207 |
} |
| 208 |
|
208 |
|
|
|
209 |
if ( C4::Context->preference('ConsiderHeadingUse') ) { |
| 210 |
my $marcflavour = C4::Context->preference('marcflavour'); |
| 211 |
my $biblio_tag = $self->{'field'}->tag; |
| 212 |
if ( $marcflavour eq 'MARC21' ) { |
| 213 |
my $heading_use_search_field = |
| 214 |
$biblio_tag =~ /^[127]/ ? 'Heading-use-main-or-added-entry' |
| 215 |
: $biblio_tag =~ /^6/ ? 'Heading-use-subject-added-entry' |
| 216 |
: $biblio_tag =~ /^[48]/ ? 'Heading-use-series-added-entry' |
| 217 |
: undef; |
| 218 |
if ($heading_use_search_field) { |
| 219 |
push @marclist, $heading_use_search_field; |
| 220 |
push @and_or, 'and'; |
| 221 |
push @excluding, ''; |
| 222 |
push @operator, 'is'; |
| 223 |
push @value, 'a'; |
| 224 |
} |
| 225 |
} |
| 226 |
} |
| 227 |
|
| 209 |
require Koha::SearchEngine::QueryBuilder; |
228 |
require Koha::SearchEngine::QueryBuilder; |
| 210 |
require Koha::SearchEngine::Search; |
229 |
require Koha::SearchEngine::Search; |
| 211 |
|
230 |
|
|
Lines 236-243
sub _search {
Link Here
|
| 236 |
) |
255 |
) |
| 237 |
) |
256 |
) |
| 238 |
{ |
257 |
{ |
| 239 |
pop @value; |
258 |
my $thesaurus_idx = first { $marclist[$_] eq 'thesaurus' } 0 .. $#marclist; |
| 240 |
push @value, 'notdefined'; |
259 |
$value[$thesaurus_idx] = 'notdefined'; |
| 241 |
$search_query = $builder->build_authorities_query_compat( |
260 |
$search_query = $builder->build_authorities_query_compat( |
| 242 |
\@marclist, \@and_or, |
261 |
\@marclist, \@and_or, |
| 243 |
\@excluding, \@operator, \@value, $self->{'auth_type'}, |
262 |
\@excluding, \@operator, \@value, $self->{'auth_type'}, |
| 244 |
- |
|
|