https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35330 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211522 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211522&action=edit Bug 35330: Add an rcn-components index for the components of a record The Record-control-number (rcn) index holds the $w of every linking field. The components of a record (analytics) were found with it, so a record that links to the host through another field, such as 776 (other physical form) or 780 (preceding entry), was also found when it was a monographic or serial component part. Bug 39287 added the rcn-volumes index for the volumes of a record. Add a similar rcn-components index, that only holds the $w of 773, the field that links a component part to its host item, for Zebra and for Elasticsearch, and use it: * in get_components_query * for the "Analytics" link of the staff interface and OPAC detail pages (which build the same query) * in place of rcn for the series links (800, 810, 811 and 830) of the staff interface and OPAC, which look for the volumes of a series, as bug 39287 did for "Show volumes" Add an atomic update for installations that already have the Elasticsearch mappings, and a test that checks that Zebra and Elasticsearch index the same fields. Existing installations need to reindex. With Zebra, copy bib1.att, ccl.properties and biblio-zebra-indexdefs.xsl to the Zebra configuration first. This depends on bug 39287. To test: 1. Create a record with a 001, for example HOST1 2. Create a record with a monographic component part Leader (07 'a') and 773$w HOST1 3. Create a record with Leader/07 'a' and 776$w HOST1 4. Create a record with Leader/07 'b' and 780$w HOST1 5. Set ShowComponentRecords to both 6. Open the first record, in the staff interface => The Components tab lists the 3 records (before this patch) 7. Apply the patch With Elasticsearch run $ perl installer/data/mysql/updatedatabase.pl With Zebra copy bib1.att, ccl.properties and biblio-zebra-indexdefs.xsl to your Zebra configuration 8. Reindex 9. Open the first record again, in the staff interface and in the OPAC => Only the record with 773$w HOST1 is listed as a component => The Analytics link searches rcn-components:HOST1 10. Run $ prove t/Koha_SearchEngine_rcn_components.t t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass! 11. Sign off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.