[Bug 33206] New: Bad title__sort made of multifield 245
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Bug ID: 33206 Summary: Bad title__sort made of multifield 245 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: januszop@gmail.com In MARC 21, having title search field defined in mappings.yaml as 245abp (more than one subfield), the Koha generated title__sort will have not only $a, but also other subfields cut by ind2 characters, i.e.: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen becomes as title__sort: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen instead of: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen This is because copying an array of pointers in Perl causes you to point to the same (anonymous) element. Therefore, the intended modification only for subfield "a" (Koha/SearchEngine/Elasticsearch.pm, ~line 1157) causes in fact modification for all the subfields sharing the same mapping definition and introduction of the nonfiling_characters_indicator to all subfields 245 when processing 245abp. And this is obviously not what is intended. -- 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=33206 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |januszop@gmail.com |ity.org | --- Comment #1 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 148103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148103&action=edit Bug 33206 - Bad title__sort made of multifield 245 In MARC 21, having title search field defined in mappings.yaml as 245abp (more than one subfield), the Koha generated title__sort will have not only $a, but also other subfields cut by ind2 characters, i.e.: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen becomes as title__sort: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen instead of: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen This is because copying an array of pointers in Perl causes you to point to the same (anonymous) element. Therefore, the intended modification only for subfield "a" (Koha/SearchEngine/Elasticsearch.pm, ~line 1157) causes in fact modification for all the subfields sharing the same mapping definition and introduction of the nonfiling_characters_indicator to all subfields 245 when processing 245abp. And this is obviously not what is intended and results (in some cases) with bad sort order when sorting by titles. Test plan ========= 1. Have a standard Koha ES installation. In mappings.yaml you should have 245abp for title search field. 2. Insert / download / modify a record with 245 $b or $p, an article at the beginning of the title, and correctly set 2nd indicator. For instance: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen 3. In ES, with Kibana or culr, control the content of title__sort field for the related document. It will be: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen 4. Apply the patch, full reindex ES (--rebuild -r -d -a -b) 5. In ES, with Kibana or culr, control the content of title__sort field for the related document. It should be now correct, i.e.: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen -- 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=33206 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Bad title__sort made of |Bad title__sort made of |multifield 245 |multisubfield 245 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 149772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149772&action=edit Bug 33206: Bad title__sort made of multifield 245 In MARC 21, having title search field defined in mappings.yaml as 245abp (more than one subfield), the Koha generated title__sort will have not only $a, but also other subfields cut by ind2 characters, i.e.: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen becomes as title__sort: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen instead of: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen This is because copying an array of pointers in Perl causes you to point to the same (anonymous) element. Therefore, the intended modification only for subfield "a" (Koha/SearchEngine/Elasticsearch.pm, ~line 1157) causes in fact modification for all the subfields sharing the same mapping definition and introduction of the nonfiling_characters_indicator to all subfields 245 when processing 245abp. And this is obviously not what is intended and results (in some cases) with bad sort order when sorting by titles. Test plan ========= 1. Have a standard Koha ES installation. In mappings.yaml you should have 245abp for title search field. 2. Insert / download / modify a record with 245 $b or $p, an article at the beginning of the title, and correctly set 2nd indicator. For instance: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen 3. In ES, with Kibana or culr, control the content of title__sort field for the related document. It will be: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen 4. Apply the patch, full reindex ES (--rebuild -r -d -a -b) 5. In ES, with Kibana or culr, control the content of title__sort field for the related document. It should be now correct, i.e.: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen Signed-off-by: Nick <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148103|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 149773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149773&action=edit Bug 33206: Unit test Signed-off-by: Nick <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Added a unit test, correct commit title, make sure the format is: Bug ####: Description it had a dash not a colon -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I just ran into this in training and glad to see there is already a fix underway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33594 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33594 [Bug 33594] Sorting results by Title A-Z might use wrong title field -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=33206 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149772|0 |1 is obsolete| | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 150138 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150138&action=edit Bug 33206: Bad title__sort made of multifield 245 In MARC 21, having title search field defined in mappings.yaml as 245abp (more than one subfield), the Koha generated title__sort will have not only $a, but also other subfields cut by ind2 characters, i.e.: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen becomes as title__sort: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen instead of: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen This is because copying an array of pointers in Perl causes you to point to the same (anonymous) element. Therefore, the intended modification only for subfield "a" (Koha/SearchEngine/Elasticsearch.pm, ~line 1157) causes in fact modification for all the subfields sharing the same mapping definition and introduction of the nonfiling_characters_indicator to all subfields 245 when processing 245abp. And this is obviously not what is intended and results (in some cases) with bad sort order when sorting by titles. Test plan ========= 1. Have a standard Koha ES installation. In mappings.yaml you should have 245abp for title search field. 2. Insert / download / modify a record with 245 $b or $p, an article at the beginning of the title, and correctly set 2nd indicator. For instance: 245 04 $a Die Renaissance : $b Architektur, Plastik, Malerei, Illustrationen, Zeichnungen 3. In ES, with Kibana or culr, control the content of title__sort field for the related document. It will be: Renaissance : itektur, Plastik, Malerei, Illustrationen, Zeichnungen 4. Apply the patch, full reindex ES (--rebuild -r -d -a -b) 5. In ES, with Kibana or culr, control the content of title__sort field for the related document. It should be now correct, i.e.: Renaissance : Architektur, Plastik, Malerei, Illustrationen, Zeichnungen Signed-off-by: Nick <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149773|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 150139 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150139&action=edit Bug 33206: Unit test Signed-off-by: Nick <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Signed-off-by: Nick <nick@bywatersolutions.com> ? Found some other 'oddness' with the title sorting, filed as bug 33594. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.05.00 |23.05.00,22.11.06 released in| | Status|Pushed to master |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=33206 --- Comment #10 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to stable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|23.05.00,22.11.06 |23.05.00,22.11.06,22.05.14 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Danyon Sewell <danyonsewell@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |danyonsewell@catalyst.net.n | |z --- Comment #12 from Danyon Sewell <danyonsewell@catalyst.net.nz> --- Not backporting for 21.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33206 Danyon Sewell <danyonsewell@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org