Bugzilla – Attachment 194206 Details for
Bug 41795
UNIMARC: a Zebra search for Corporate Body Name authorities will also return Collective Titles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41795: Include the completeness attribute when matching on authtype
2194631.patch (text/plain), 2.76 KB, created by
David Nind
on 2026-02-28 22:43:42 UTC
(
hide
)
Description:
Bug 41795: Include the completeness attribute when matching on authtype
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-02-28 22:43:42 UTC
Size:
2.76 KB
patch
obsolete
>From 2194631c4ffd6e680930f1a53369d255c11c8fba Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <a.roussos@dataly.gr> >Date: Mon, 9 Feb 2026 00:17:08 +0000 >Subject: [PATCH] Bug 41795: Include the completeness attribute when matching > on authtype > >UNIMARC instances include the following two authority types >by default (among others): Corporate Body Name (code: 'CO') >and Collective Title (code: 'CO_UNI_TI'). > >The problem is that when searching for Corporate Body Name >authorities (in the OPAC or in the Staff interface), the >results will include Collective Title authorities as well. >It has to do with Corporate Body Name authorities using >an authtypecode (CO) that happens to be the prefix of the >authtypecode (CO_UNI_TI) used by Collective Titles. > >NOTE: Elasticsearch is not affected by this. > >The fix is to additionally pass the completeness attribute >to the RPN query sent to Zebra so that it will try to match >on what is literally found in the entire field's phrase >index (i.e. the value of UNIMARC 152$b), instead of performing >a partial match. > >More information can be found at the official documentation: >https://software.indexdata.com/zebra/doc/querymodel-rpn.html#querymodel-bib1-completeness > >Test plan (tailored for KTD): > >0) Launch a UNIMARC Koha instance using Zebra: > > ktd --marcflavour unimarc --search-engine zebra up > >1) Import the Sample MARC record attached to this Bug, > containing a single Collective Title authority > (adding one manually would take a long time due to > the many mandatory subfields). > >2) Perform a generic authority search (without entering > anything in the search box) for all 'Corporate Body > Name' authorities. Note the number of results returned > (83), and also notice that in page 4 of the results you > get a stray 'Collective Title' authority ("Selected > works", the one you imported in Step 1). > >3) Apply this patch (and `restart_all`). > >4) Repeat the same search as in Step 2. This time, the > number of results returned should be one less than > before (82), and you should only see 'Corporate Body > Name' authorities in the results. > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/AuthoritiesMarc.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index c2070f4560..5a46089f29 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -134,7 +134,7 @@ sub SearchAuthorities { > my @authtypecode; > my @auths = split / /, $authtypecode; > foreach my $auth (@auths) { >- $query .= " \@attr 1=authtype \@attr 5=100 " . $auth; ##No truncation on authtype >+ $query .= " \@attr 1=authtype \@attr 5=100 \@attr 6=3 " . $auth; ##No truncation on authtype > push @authtypecode, $auth; > $n++; > } >-- >2.39.5 >
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 41795
:
192687
|
192688
|
192689
|
192690
|
192710
| 194206 |
194207