In C4/Heading/MARC21.pm when we call _get_search_heading we look at the heading and turn some subfields into terms so: 150 $aChess$xOpenings becomes 'Chess generalsubdiv openings' 126 my %subdivisions = ( 127 'v' => 'formsubdiv', 128 'x' => 'generalsubdiv', 129 'y' => 'chronologicalsubdiv', 130 'z' => 'geographicsubdiv', 131 ); 267 $heading .= " $subdivisions{$code} $value"; We don't do this when indexing into ES so we will never find matches for these records
Created attachment 97357 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags
Created attachment 97981 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags To test: 1 - Be using Elasticsearch 2 - Check that field 150 is mapped to 'Match-heading' or add it (the subfields don't matter) 3 - Add a topic term authority record like "150 $aCats$vFiction" 4 - Add a 650 with $aCats and $vFiction and $e depicted to a bibliographic record 5 - Run the linker for the bib perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v 6 - Confirm the record is not correctly linked to the record 7 - Apply patch 8 - Reindex authorities for ES perl misc/search_tools/rebuild_elasticsearch.pl -v -d -a 9 - Run the linker and confirm record is correctly linked perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v
Created attachment 97982 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags To test: 1 - Be using Elasticsearch 2 - Check that field 150 is mapped to 'Match-heading' or add it (the subfields don't matter) 3 - Add a topic term authority record like "150 $aCats$vFiction" 4 - Add a 650 with $aCats and $vFiction and $e depicted to a bibliographic record 5 - Run the linker for the bib perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v 6 - Confirm the record is not correctly linked to the record 7 - Apply patch 8 - Reindex authorities for ES perl misc/search_tools/rebuild_elasticsearch.pl -v -d -a 9 - Run the linker and confirm record is correctly linked perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v
Comment on attachment 97982 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags Review of attachment 97982 [details] [review]: ----------------------------------------------------------------- ::: C4/Heading.pm @@ +52,5 @@ > > Given a C<MARC::Field> object containing a heading from a > bib record, create a C<C4::Heading> object. > > +The optional third parameter is 'auth' - it is handled as boolean. If supplied we treat the field as an auth record field. Otherwise if it is a bib field. The fields checked are the same in a UNIMARC system and this parameter is ignored I'm not sure I understand this rewording.. you've removed the '$marc_flavour' param right, and instead, always use the application context? I think this could be more clearly worded.
Created attachment 97996 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags To test: 1 - Be using Elasticsearch 2 - Check that field 150 is mapped to 'Match-heading' or add it (the subfields don't matter) 3 - Add a topic term authority record like "150 $aCats$vFiction" 4 - Add a 650 with $aCats and $vFiction and $e depicted to a bibliographic record 5 - Run the linker for the bib perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v 6 - Confirm the record is not correctly linked to the record 7 - Apply patch 8 - Reindex authorities for ES perl misc/search_tools/rebuild_elasticsearch.pl -v -d -a 9 - Run the linker and confirm record is correctly linked perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signing off as this logically all makes sense, the tests pass and it passes it's test plan. Minor comment about rewording the updated POD slightly as it's not entirely clear without reading the code.
(In reply to Martin Renvoize from comment #4) > Comment on attachment 97982 [details] [review] [review] > Bug 24269: Adjust C4::Heading to generate headings from auth tags > > Review of attachment 97982 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: C4/Heading.pm > @@ +52,5 @@ > > > > Given a C<MARC::Field> object containing a heading from a > > bib record, create a C<C4::Heading> object. > > > > +The optional third parameter is 'auth' - it is handled as boolean. If supplied we treat the field as an auth record field. Otherwise if it is a bib field. The fields checked are the same in a UNIMARC system and this parameter is ignored > > I'm not sure I understand this rewording.. you've removed the > '$marc_flavour' param right, and instead, always use the application > context? I think this could be more clearly worded. I did, I didn't mention it in the POD, meant to mention in the commit message - we had that option, but it was never used and I didn't see a reason to preserve it
Created attachment 99039 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags To test: 1 - Be using Elasticsearch 2 - Check that field 150 is mapped to 'Match-heading' or add it (the subfields don't matter) 3 - Add a topic term authority record like "150 $aCats$vFiction" 4 - Add a 650 with $aCats and $vFiction and $e depicted to a bibliographic record 5 - Run the linker for the bib perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v 6 - Confirm the record is not correctly linked to the record 7 - Apply patch 8 - Reindex authorities for ES perl misc/search_tools/rebuild_elasticsearch.pl -v -d -a 9 - Run the linker and confirm record is correctly linked perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
We now have a double signoff on this including my own.. I'll do a quick final check before pushing but I think we can safely say this is PQA
Created attachment 99246 [details] [review] Bug 24269: Adjust C4::Heading to generate headings from auth tags To test: 1 - Be using Elasticsearch 2 - Check that field 150 is mapped to 'Match-heading' or add it (the subfields don't matter) 3 - Add a topic term authority record like "150 $aCats$vFiction" 4 - Add a 650 with $aCats and $vFiction and $e depicted to a bibliographic record 5 - Run the linker for the bib perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v 6 - Confirm the record is not correctly linked to the record 7 - Apply patch 8 - Reindex authorities for ES perl misc/search_tools/rebuild_elasticsearch.pl -v -d -a 9 - Run the linker and confirm record is correctly linked perl misc/link_bibs_to_authorities.pl --bib-limit "biblionumber=89" -v Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x for 19.11.04