|
Lines 23-28
use MARC::Record;
Link Here
|
| 23 |
|
23 |
|
| 24 |
use Koha::SearchEngine; |
24 |
use Koha::SearchEngine; |
| 25 |
use Koha::SearchEngine::Search; |
25 |
use Koha::SearchEngine::Search; |
|
|
26 |
use Koha::SearchEngine::QueryBuilder; |
| 26 |
use Koha::Util::Normalize qw/legacy_default remove_spaces upper_case lower_case/; |
27 |
use Koha::Util::Normalize qw/legacy_default remove_spaces upper_case lower_case/; |
| 27 |
|
28 |
|
| 28 |
=head1 NAME |
29 |
=head1 NAME |
|
Lines 689-695
sub get_matches {
Link Here
|
| 689 |
|
690 |
|
| 690 |
} |
691 |
} |
| 691 |
elsif ( $self->{'record_type'} eq 'authority' ) { |
692 |
elsif ( $self->{'record_type'} eq 'authority' ) { |
| 692 |
my $authresults; |
|
|
| 693 |
my @marclist; |
693 |
my @marclist; |
| 694 |
my @and_or; |
694 |
my @and_or; |
| 695 |
my @excluding = []; |
695 |
my @excluding = []; |
|
Lines 701-713
sub get_matches {
Link Here
|
| 701 |
push @operator, 'exact'; |
701 |
push @operator, 'exact'; |
| 702 |
push @value, $key; |
702 |
push @value, $key; |
| 703 |
} |
703 |
} |
| 704 |
require C4::AuthoritiesMarc; |
704 |
my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); |
| 705 |
( $authresults, $total_hits ) = |
705 |
my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); |
| 706 |
C4::AuthoritiesMarc::SearchAuthorities( |
706 |
my $search_query = $builder->build_authorities_query_compat( |
| 707 |
\@marclist, \@and_or, \@excluding, \@operator, |
707 |
\@marclist, \@and_or, \@excluding, \@operator, |
| 708 |
\@value, 0, 20, undef, |
708 |
\@value, undef, 'AuthidAsc' |
| 709 |
'AuthidAsc', 1 |
709 |
); |
| 710 |
); |
710 |
my ( $authresults, $total ) = $searcher->search_auth_compat( $search_query, 0, 20 ); |
|
|
711 |
|
| 711 |
foreach my $result (@$authresults) { |
712 |
foreach my $result (@$authresults) { |
| 712 |
my $id = $result->{authid}; |
713 |
my $id = $result->{authid}; |
| 713 |
$matches->{$id}->{score} += $matchpoint->{'score'}; |
714 |
$matches->{$id}->{score} += $matchpoint->{'score'}; |
| 714 |
- |
|
|