|
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 687-693
sub get_matches {
Link Here
|
| 687 |
|
688 |
|
| 688 |
} |
689 |
} |
| 689 |
elsif ( $self->{'record_type'} eq 'authority' ) { |
690 |
elsif ( $self->{'record_type'} eq 'authority' ) { |
| 690 |
my $authresults; |
|
|
| 691 |
my @marclist; |
691 |
my @marclist; |
| 692 |
my @and_or; |
692 |
my @and_or; |
| 693 |
my @excluding = []; |
693 |
my @excluding = []; |
|
Lines 699-711
sub get_matches {
Link Here
|
| 699 |
push @operator, 'exact'; |
699 |
push @operator, 'exact'; |
| 700 |
push @value, $key; |
700 |
push @value, $key; |
| 701 |
} |
701 |
} |
| 702 |
require C4::AuthoritiesMarc; |
702 |
my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); |
| 703 |
( $authresults, $total_hits ) = |
703 |
my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); |
| 704 |
C4::AuthoritiesMarc::SearchAuthorities( |
704 |
my $search_query = $builder->build_authorities_query_compat( |
| 705 |
\@marclist, \@and_or, \@excluding, \@operator, |
705 |
\@marclist, \@and_or, \@excluding, \@operator, |
| 706 |
\@value, 0, 20, undef, |
706 |
\@value, undef, 'AuthidAsc' |
| 707 |
'AuthidAsc', 1 |
707 |
); |
| 708 |
); |
708 |
my ( $authresults, $total ) = $searcher->search_auth_compat( $search_query, 0, 20 ); |
|
|
709 |
|
| 709 |
foreach my $result (@$authresults) { |
710 |
foreach my $result (@$authresults) { |
| 710 |
my $id = $result->{authid}; |
711 |
my $id = $result->{authid}; |
| 711 |
$matches->{$id}->{score} += $matchpoint->{'score'}; |
712 |
$matches->{$id}->{score} += $matchpoint->{'score'}; |
| 712 |
- |
|
|