[Bug 43498] New: UNIMARC: authority search returns no results when the authority type is only in 942$a
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Bug ID: 43498 Summary: UNIMARC: authority search returns no results when the authority type is only in 942$a Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Zebra Assignee: koha-bugs@lists.koha-community.org Reporter: kdask@altsol.gr QA Contact: testopia@bugs.koha-community.org Depends on: 41795 Target Milestone: --- Bug 41795 added the completeness attribute (@attr 6=3) to the authtype clause in C4::AuthoritiesMarc::SearchAuthorities. Complete-field matching resolves against Zebra's phrase ('p') register. The UNIMARC authority index definitions build the authtype index from two places: - 152$b -> authtype:w authtype:p - 942$a -> authtype:w (word register only) On UNIMARC installations whose authority records carry the authority type in 942$a only (no 152 coded data field -- common in real-world UNIMARC sites), the authtype phrase register is empty, so every type-filtered authority search returns zero results. In particular, the authority finder launched from the bibliographic editor (e.g. on field 600) always passes an authtypecode, so cataloguers cannot search or link authorities at all. We hit this on three independent production UNIMARC installations (different servers, different Koha and Zebra builds) immediately after upgrading to releases containing Bug 41795 (26.05.00 / 25.11.05). On all of them nearly all authority records have the type in 942$a and no 152$b. Reproduced on current main with KTD (unimarc flavour, Zebra 2.2.8): 1) Create an authority whose type is in 942$a only; full authorities reindex. 2) Authority search with a type filter -> 0 results; the same search without a type filter finds the record. 3) yaz-client against the authority socket confirms the mechanism: @attr 1=authtype @attr 5=100 @attr 6=3 <value> -> 0 hits @attr 1=authtype @attr 5=100 <value> -> 1 hit The Bug 41795 follow-up ("add a phrase Zebra index for 'authtype'") fixed exactly this for MARC21 after the Jenkins failures, but the UNIMARC definitions were not updated (their 152$b block already had a :p index, which masked the 942$a case). The patch (to be attached) applies the same one-line change to the UNIMARC definitions: add authtype:p to the 942$a block in authority-koha-indexdefs.xml, with the regenerated authority-zebra-indexdefs.xsl. A full authorities reindex is required after applying -- worth flagging prominently if this gets backported (cf. Bug 41795 comment 19). Elasticsearch is not affected. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41795 [Bug 41795] UNIMARC: a Zebra search for Corporate Body Name authorities will also return Collective Titles -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Kdask <kdask@altsol.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |kdask@altsol.gr |ity.org | --- Comment #1 from Kdask <kdask@altsol.gr> --- Created attachment 205332 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205332&action=edit Bug 43498: Add a phrase Zebra index for 'authtype' in UNIMARC 942$a -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |f.demians@tamil.fr --- Comment #2 from Frédéric Demians <f.demians@tamil.fr> --- It seems "strange" that authority type is in 942$a rather than in 152$b. On every new installation, 152$b is used. When you import authorities, 152$b is used. Is it something "historic" in you installations? Why wouldn't you change you configuration to align it to standard, and batch modify records? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Comma delimited| |Altsol list of Sponsors| | Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205332|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 --- Comment #3 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 207943 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207943&action=edit Bug 43498: Add a phrase Zebra index for 'authtype' in UNIMARC 942$a Bug 41795 added the completeness attribute (@attr 6=3) to the authtype clause of authority searches. As per https://software.indexdata.com/zebra/doc/querymodel-rpn.html#querymodel-bib1...: "[...] Complete field (3) triggers search and scan in index type="p"." The UNIMARC Zebra authority index definitions include a 'p' (phrase) type index for authtype built from 152$b, but the 942$a block only indexes 'authtype:w'. As a result, on UNIMARC instances whose authority records carry the authority type in 942$a only (with no 152$b), every type-filtered authority search returns zero results -- including the authority finder launched from the bibliographic editor (e.g. on field 600), which always passes an authtypecode. The MARC21 index definitions received the equivalent fix in the Bug 41795 follow-up ("add a phrase Zebra index for 'authtype'"); this patch applies the same one-line change to the UNIMARC definitions. NOTE: Elasticsearch is not affected. Existing installations must do a full authorities reindex for this change to take effect. Test plan (tailored for KTD): 0) Launch a UNIMARC Koha instance using Zebra: ktd --marcflavour unimarc up 1) Create an authority record whose type is stored in 942$a only, i.e. with no 152$b field (this mirrors real-world UNIMARC sites that do not use the 152 coded data field), then do a full authorities reindex: k$ koha-rebuild-zebra -a -f -v kohadev 2) In the Staff interface, edit a bibliographic record, and on a field linked to that authority type (e.g. 600) launch the authority finder and search for the record from Step 1. => The search returns no results. The same search without a type filter (Authority search with 'Default') finds it. 3) Apply this patch, then deploy the updated definitions and reindex: k$ sudo cp etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml /etc/koha/zebradb/marc_defs/unimarc/authorities/ k$ sudo cp etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/unimarc/authorities/ k$ koha-rebuild-zebra -a -f -v kohadev 4) Repeat the search from Step 2. => The authority record is now found. Sponsored-by: Altsol Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CNyQfnYVu99DxGfr5hhG3b Signed-off-by: Frédéric Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 --- Comment #4 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 207944 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207944&action=edit Bug 43498: (follow-up) Add tests for the authtype Zebra authority indexes Since bug 41795, SearchAuthorities matches authtype with the completeness attribute, which only looks at the phrase register. Neither the MARC21 follow-up of bug 41795 nor this bug added a test. So here it is... t/Zebra_authority_indexdefs.t needs no database and no Zebra server. For For MARC21/UNIMARC authority index definitions, it checks that: - every field indexed as authtype also feeds authtype:p, - authority-zebra-indexdefs.xsl is up to date with authority-koha-indexdefs.xml. => this one may help in the future to avoid desynchronization Test plan: 1. prove t/Zebra_authority_indexdefs.t => passes 2. Remove authtype:p from the 942$a block in etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml and run the test again => fails with "Missing authtype:p in: index_subfields 942" and "authority-zebra-indexdefs.xsl matches its regenerated version" 3. Modify anything in MARC21/UNIMARC authority-kohaèindexdefs.xml without regenerating xsl counterpart => test fails: authority-zebra-indexdefs.xsl matches its regenerated version 4. git checkout etc/zebradb -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207943|0 |1 is obsolete| | Attachment #207944|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 --- Comment #5 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 208897 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208897&action=edit Bug 43498: Add a phrase Zebra index for 'authtype' in UNIMARC 942$a Bug 41795 added the completeness attribute (@attr 6=3) to the authtype clause of authority searches. As per https://software.indexdata.com/zebra/doc/querymodel-rpn.html#querymodel-bib1...: "[...] Complete field (3) triggers search and scan in index type="p"." The UNIMARC Zebra authority index definitions include a 'p' (phrase) type index for authtype built from 152$b, but the 942$a block only indexes 'authtype:w'. As a result, on UNIMARC instances whose authority records carry the authority type in 942$a only (with no 152$b), every type-filtered authority search returns zero results -- including the authority finder launched from the bibliographic editor (e.g. on field 600), which always passes an authtypecode. The MARC21 index definitions received the equivalent fix in the Bug 41795 follow-up ("add a phrase Zebra index for 'authtype'"); this patch applies the same one-line change to the UNIMARC definitions. NOTE: Elasticsearch is not affected. Existing installations must do a full authorities reindex for this change to take effect. Test plan (tailored for KTD): 0) Launch a UNIMARC Koha instance using Zebra: ktd --marcflavour unimarc up 1) Create an authority record whose type is stored in 942$a only, i.e. with no 152$b field (this mirrors real-world UNIMARC sites that do not use the 152 coded data field), then do a full authorities reindex: k$ koha-rebuild-zebra -a -f -v kohadev 2) In the Staff interface, edit a bibliographic record, and on a field linked to that authority type (e.g. 600) launch the authority finder and search for the record from Step 1. => The search returns no results. The same search without a type filter (Authority search with 'Default') finds it. 3) Apply this patch, then deploy the updated definitions and reindex: k$ sudo cp etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml /etc/koha/zebradb/marc_defs/unimarc/authorities/ k$ sudo cp etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/unimarc/authorities/ k$ koha-rebuild-zebra -a -f -v kohadev 4) Repeat the search from Step 2. => The authority record is now found. Sponsored-by: Altsol Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CNyQfnYVu99DxGfr5hhG3b Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 208898 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208898&action=edit Bug 43498: (follow-up) Add tests for the authtype Zebra authority indexes Since bug 41795, SearchAuthorities matches authtype with the completeness attribute, which only looks at the phrase register. Neither the MARC21 follow-up of bug 41795 nor this bug added a test. So here it is... t/Zebra_authority_indexdefs.t needs no database and no Zebra server. For For MARC21/UNIMARC authority index definitions, it checks that: - every field indexed as authtype also feeds authtype:p, - authority-zebra-indexdefs.xsl is up to date with authority-koha-indexdefs.xml. => this one may help in the future to avoid desynchronization Test plan: 1. prove t/Zebra_authority_indexdefs.t => passes 2. Remove authtype:p from the 942$a block in etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml and run the test again => fails with "Missing authtype:p in: index_subfields 942" and "authority-zebra-indexdefs.xsl matches its regenerated version" 3. Modify anything in MARC21/UNIMARC authority-kohaèindexdefs.xml without regenerating xsl counterpart => test fails: authority-zebra-indexdefs.xsl matches its regenerated version 4. git checkout etc/zebradb Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Pushed to main for 26.11 with consent from Pedro whilst he's focusing on reviewing enhancements and new features from the queue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.11.00 |26.11.00,26.05.06 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43498 --- Comment #8 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to 26.05.x for the upcoming 26.05.06 release. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org