Summary: | Unknown authority types break elasticsearch authorities indexing | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Searching - Elasticsearch | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P5 - low | CC: | andrew, david, fridolin.somers, jean-manuel.broust, m.de.rooy, martin.renvoize, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This patch fixes Elasticsearch indexing failures caused by 'SUBDIV' type authority records in Koha. It skips the step of parsing the authorities into the linking form if the type contains '_SUBD'.
Notes:
- Koha currently doesn't have support for 'SUBDIV' type authority records.
- They can be added to the authority types in the staff interface, however, values are hard coded in various modules and Koha has no concept of how to link a subfield heading to a record, as we only deal in whole fields.
|
Version(s) released in: |
21.05.00,20.11.04,20.05.10,19.11.16
|
Circulation function: | |||
Attachments: |
Bug 27784: Unit tests
Bug 27784: Don't parse subdivision authorities as headings Sample record Bug 27784: Unit tests Bug 27784: Don't parse subdivision authorities as headings Bug 27784: Unit tests Bug 27784: Don't parse subdivision authorities as headings |
Description
Nick Clemens (kidclamp)
2021-02-24 20:42:07 UTC
Created attachment 117378 [details] [review] Bug 27784: Unit tests Created attachment 117379 [details] [review] Bug 27784: Don't parse subdivision authorities as headings Subdivision authorities are not used for linking, however, they are recognized by C4::AuthoritiesMarc While these records are not used for linking, they could provide reference and should be allowed to exist in the catalog without breaking ES indexing THis patch simply skips the step of parsing the authorities into the linking form if the type contains '_SUBD' To test: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. 4 - Apply patches 5 - reindex 6 - Success! Created attachment 117401 [details]
Sample record
Created attachment 117459 [details] [review] Bug 27784: Unit tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 117460 [details] [review] Bug 27784: Don't parse subdivision authorities as headings Subdivision authorities are not used for linking, however, they are recognized by C4::AuthoritiesMarc While these records are not used for linking, they could provide reference and should be allowed to exist in the catalog without breaking ES indexing THis patch simply skips the step of parsing the authorities into the linking form if the type contains '_SUBD' To test: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. 4 - Apply patches 5 - reindex 6 - Success! Signed-off-by: David Nind <david@davidnind.com> Thanks Nick for providing a sample record! Created attachment 117563 [details] [review] Bug 27784: Unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 117564 [details] [review] Bug 27784: Don't parse subdivision authorities as headings Subdivision authorities are not used for linking, however, they are recognized by C4::AuthoritiesMarc While these records are not used for linking, they could provide reference and should be allowed to exist in the catalog without breaking ES indexing THis patch simply skips the step of parsing the authorities into the linking form if the type contains '_SUBD' To test: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. 4 - Apply patches 5 - reindex 6 - Success! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> A reasonable and pragmatic solution to the issue. Whilst it would be nice to add support for subdivision linking, this patch is a pragmatic solution to prevent indexing explosions. It works as expected, has a unit regression test and passes the QA script. Passing QA Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.04 Pushed to 20.05.x for 20.05.10 Backported: Pushed to 19.11.x branch for 19.11.16 |