| 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 210-215
          sub _search {
      
      
        Link Here | 
        
          | 210 |         push @value,     $thesaurus; | 210 |         push @value,     $thesaurus; | 
        
          | 211 |     } | 211 |     } | 
        
          | 212 |  | 212 |  | 
            
              |  |  | 213 |     if ( C4::Context->preference('ConsiderHeadingUse') ) { | 
            
              | 214 |         my $marcflavour = C4::Context->preference('marcflavour'); | 
            
              | 215 |         my $biblio_tag  = $self->{'field'}->tag; | 
            
              | 216 |         if ( $marcflavour eq 'MARC21' ) { | 
            
              | 217 |             my $heading_use_search_field = | 
            
              | 218 |                   $biblio_tag =~ /^[127]/ ? 'Heading-use-main-or-added-entry' | 
            
              | 219 |                 : $biblio_tag =~ /^6/     ? 'Heading-use-subject-added-entry' | 
            
              | 220 |                 : $biblio_tag =~ /^[48]/  ? 'Heading-use-series-added-entry' | 
            
              | 221 |                 :                           undef; | 
            
              | 222 |             if ($heading_use_search_field) { | 
            
              | 223 |                 push @marclist,  $heading_use_search_field; | 
            
              | 224 |                 push @and_or,    'and'; | 
            
              | 225 |                 push @excluding, ''; | 
            
              | 226 |                 push @operator,  'is'; | 
            
              | 227 |                 push @value,     'a'; | 
            
              | 228 |             } | 
            
              | 229 |         } | 
            
              | 230 |     } | 
            
              | 231 |  | 
        
          | 213 |     require Koha::SearchEngine::QueryBuilder; | 232 |     require Koha::SearchEngine::QueryBuilder; | 
        
          | 214 |     require Koha::SearchEngine::Search; | 233 |     require Koha::SearchEngine::Search; | 
        
          | 215 |  | 234 |  | 
  
    | Lines 240-247
          sub _search {
      
      
        Link Here | 
        
          | 240 |         ) | 259 |         ) | 
        
          | 241 |         ) | 260 |         ) | 
        
          | 242 |     { | 261 |     { | 
          
            
              | 243 |         pop @value; | 262 |         my $thesaurus_idx = first { $marclist[$_] eq 'thesaurus' } 0 .. $#marclist; | 
            
              | 244 |         push @value, 'notdefined'; | 263 |         $value[$thesaurus_idx] = 'notdefined'; | 
        
          | 245 |         $search_query = $builder->build_authorities_query_compat( | 264 |         $search_query = $builder->build_authorities_query_compat( | 
        
          | 246 |             \@marclist,  \@and_or, | 265 |             \@marclist,  \@and_or, | 
        
          | 247 |             \@excluding, \@operator, \@value, $self->{'auth_type'}, | 266 |             \@excluding, \@operator, \@value, $self->{'auth_type'}, | 
            
              | 248 | -  |  |  |