Bugzilla – Attachment 82407 Details for
Bug 19365
link_bibs_to_authorities.pl doesn't work with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19365: Fix search for duplicate authorities with Elasticsearch
Bug-19365-Fix-search-for-duplicate-authorities-wit.patch (text/plain), 2.29 KB, created by
Martin Renvoize (ashimema)
on 2018-11-16 16:41:01 UTC
(
hide
)
Description:
Bug 19365: Fix search for duplicate authorities with Elasticsearch
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-11-16 16:41:01 UTC
Size:
2.29 KB
patch
obsolete
>From e981e8dfee32f1f5a066ae72ada51308801c2b2a Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Mon, 17 Sep 2018 00:10:22 +0300 >Subject: [PATCH] Bug 19365: Fix search for duplicate authorities with > Elasticsearch > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/AuthoritiesMarc.pm | 2 +- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 ++ > Koha/SearchEngine/Elasticsearch/Search.pm | 10 +++++----- > 3 files changed, 8 insertions(+), 6 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 98d73f7892..780380ece8 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -760,7 +760,7 @@ sub FindDuplicateAuthority { > if ($QParser) { > $op = '&&'; > } else { >- $op = 'and'; >+ $op = 'AND'; > } > my $query='at:'.$authtypecode.' '; > my $filtervalues=qr([\001-\040\Q!'"`#$%&*+,-./:;<=>?@(){[}_|~\E\]]); >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 254fba2c9e..543728e841 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -523,6 +523,8 @@ our %index_field_convert = ( > 'mus' => 'rtype', > 'aud' => 'ta', > 'hi' => 'Host-Item-Number', >+ 'at' => 'authtype', >+ 'he' => 'Heading' > ); > > sub _convert_index_fields { >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index b7f139f1c1..68cb0eca54 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -344,11 +344,11 @@ sub simple_search_compat { > } > my $results = $self->search($query, undef, $max_results, %options); > my @records; >- $results->each(sub { >- my $marc = $self->decode_record_from_result(@_); >- push @records, $marc; >- }); >- return (undef, \@records, $results->total); >+ my $hits = $results->{'hits'}; >+ foreach my $es_record (@{$hits->{'hits'}}) { >+ push @records, $self->decode_record_from_result($es_record->{'_source'}); >+ } >+ return (undef, \@records, $hits->{'total'}); > } > > =head2 extract_biblionumber >-- >2.19.1
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 19365
:
71109
|
71114
|
73382
|
78732
|
78737
|
78875
|
79005
|
79006
|
79007
|
82282
|
82283
|
82284
|
82303
|
82304
|
82305
|
82307
|
82312
|
82313
|
82314
|
82325
|
82326
|
82327
|
82328
|
82406
|
82407
|
82408
|
82409
|
82410
|
82411
|
82412
|
82413
|
82414
|
82530
|
82531
|
82532
|
82533
|
82534