Bugzilla – Attachment 92634 Details for
Bug 23004
Missing authtype filter in auth_finder.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23004: Missing authtype filter in auth_finder.pl
Bug-23004-Missing-authtype-filter-in-authfinderpl.patch (text/plain), 1.73 KB, created by
Kyle M Hall (khall)
on 2019-09-06 11:19:57 UTC
(
hide
)
Description:
Bug 23004: Missing authtype filter in auth_finder.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-09-06 11:19:57 UTC
Size:
1.73 KB
patch
obsolete
>From 6ce8c7b16894b3ce055488b2966fd475b3b32691 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 29 May 2019 08:15:08 +0200 >Subject: [PATCH] Bug 23004: Missing authtype filter in auth_finder.pl > >In cataloguing, the use of tag editor opens authorities finder with a limit on specific authorities type. >This limit is missing with Elasticsearch. > >This patch adds in query a "filter" on "term" which is the most performant way because there must be no ranking computed on this part. > >Test plan : >1) Use Elasticsearch >2) Create an autority of type author (NP in UNIMARC) with heading "Tolkien" >3) Create an autority of type subject-author (SAUT in UNIMARC) with heading "Tolkien" >4) Create a biblio record >5) Use tag editor on a author field (700 in UNIMARC) >6) Seach for "Tolkien" in $a >without patch : you see the 2 authorities in results >with patch : you see only the correct authority in results (NP in UNIMARC) >7) Check search in authorities-home.pl is still OK > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 5c4eb62463..ce59ff0d54 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -350,6 +350,9 @@ sub build_authorities_query { > { must => \@query_parts } > } > }; >+ if ( $search->{authtypecode} ) { >+ $query->{query}->{bool}->{filter} = { term => { 'authtype' => lc $search->{authtypecode} } }; >+ } > > my %s; > if ( exists $search->{sort} ) { >-- >2.20.1 (Apple Git-117)
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 23004
:
90174
|
92056
|
92632
|
92634
|
92635
|
92670
|
92671