Bugzilla – Attachment 69088 Details for
Bug 18131
Matching staged records when using elastic search fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18131: ES - Fix matching staged records - Authority
Bug-18131-ES---Fix-matching-staged-records---Autho.patch (text/plain), 2.42 KB, created by
Julian Maurice
on 2017-11-10 14:00:48 UTC
(
hide
)
Description:
Bug 18131: ES - Fix matching staged records - Authority
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-11-10 14:00:48 UTC
Size:
2.42 KB
patch
obsolete
>From dd6d4c128464a5663426773ff08a7ba0840b8c9e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 23 Mar 2017 14:44:54 -0300 >Subject: [PATCH] Bug 18131: ES - Fix matching staged records - Authority > >Occurrences of C4::AuthoritiesMarc::SearchAuthorities must be replaced >by search_auth_compat. > >You need to define the search index of matching rule with one of the >values defined in %koha_to_index_name (from >Koha::SearchEngine::Elasticsearch::QueryBuilder::build_authorities_query_compat) > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > C4/Matcher.pm | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 01fdbc63c8..82840ebec1 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -23,6 +23,7 @@ use MARC::Record; > > use Koha::SearchEngine; > use Koha::SearchEngine::Search; >+use Koha::SearchEngine::QueryBuilder; > use Koha::Util::Normalize qw/legacy_default remove_spaces upper_case lower_case/; > > =head1 NAME >@@ -689,7 +690,6 @@ sub get_matches { > > } > elsif ( $self->{'record_type'} eq 'authority' ) { >- my $authresults; > my @marclist; > my @and_or; > my @excluding = []; >@@ -701,13 +701,14 @@ sub get_matches { > push @operator, 'exact'; > push @value, $key; > } >- require C4::AuthoritiesMarc; >- ( $authresults, $total_hits ) = >- C4::AuthoritiesMarc::SearchAuthorities( >- \@marclist, \@and_or, \@excluding, \@operator, >- \@value, 0, 20, undef, >- 'AuthidAsc', 1 >- ); >+ my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); >+ my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::AUTHORITIES_INDEX}); >+ my $search_query = $builder->build_authorities_query_compat( >+ \@marclist, \@and_or, \@excluding, \@operator, >+ \@value, undef, 'AuthidAsc' >+ ); >+ my ( $authresults, $total ) = $searcher->search_auth_compat( $search_query, 0, 20 ); >+ > foreach my $result (@$authresults) { > my $id = $result->{authid}; > $matches->{$id}->{score} += $matchpoint->{'score'}; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18131
:
60716
|
61586
|
62087
|
62088
|
68884
|
69087
| 69088 |
69089