Koha-clms/Koha
Jacek Ablewicz e64d9b63a7 Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields
If the system preference IncludeSeeFromInSearches is enabled, records
exported for zebra indexing are being additionally processed by
EmbedSeeFromHeadings record filter (right now used only in rebuild_zebra.pl
script). This filter embeds 'see from' fields (extracted from authority
records linked with the given biblio via $9 subfields) into target MARC
record, which is then subsequently indexed in zebra.

Currently all fields containing $9 are getting the same exact treatment
by this filter. But on the export stage when the filter is applied, MARC
record being processed already does have holdings data fields added in
the previous stage (usually 952 / 995, depending on the MARC format).
Problem is that holdings data fields use to have $9 subfields in them
as well (mapped to item.itemnumber by default). As a consequence, some
(great many in the typical setup) records exported for zebra indexing
may have surplus "see from" fields added erroneously in semi-random
fashion, so biblio searches would often return some completely
unexpected additional results.

EmbedSeeFromHeadings record filter should not process holdings fields
when dealing with MARC records intended for zebra indexing.

To reproduce:

1) database with as many sample or real-world biblio, item and authority
records as possible is recommended for testing purposes
2) enable IncludeSeeFromInSearches
3) export a bunch of biblio records for zebra (e.g.:
misc/migration_tools/rebuild_zebra.pl -I -b -x -k -length=1000),
inspect the result xml records in /tmp/<whatever> file; observe that at
the end of many records, here and there some extra "see from" (= 1st
indicator: 'z') fields tend to appear, which shouldn't be there ;)

To test:

4) apply patch
5) redo 3)
6) compare results from 3) and 5) with diff

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I introduced a regression test for this. You should run the tests
without/with the patch and verify that the patch actually fixes the problem.
Good job Jacek! I'm sure writing the regression test would take less time
than such a detailed commit message!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3a8b7a0e1)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
2015-08-11 09:19:16 +12:00
..
Acquisition Bug 13319: Fix Koha::Acq::Order should set parent_ordernumber 2015-02-14 20:26:53 +13:00
Borrower Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Cache Bug 12041 - improve Koha::Cache 2014-06-19 13:05:04 -03:00
Filter/MARC Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields 2015-08-11 09:19:16 +12:00
Indexer Bug 10143 - Fixing license headers 2013-05-01 06:47:50 -04:00
Item/Search Bug 11425: Add unit tests 2014-11-04 19:10:28 -03:00
List Bug 15065: (follow-up) update license header 2013-10-14 21:50:10 +00:00
Misc Bug 3050 - Add an option to upload scanned invoices #1/3 2014-05-25 21:14:00 +00:00
Number Bug 13836: Does not separate symbol and value if symbol is not displayed. 2015-03-22 18:12:50 +13:00
Plugins Bug 14467: Security updates break some Koha plugins 2015-07-16 10:05:52 +00:00
QueryParser/Driver Bug 12647: PQF QueryParser driver and unit tests fixes 2014-08-11 10:09:38 -03:00
RecordProcessor Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Schema/Result Bug 13523: DBIC updates 2015-03-11 08:12:17 +13:00
SuggestionEngine Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Template/Plugin Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Util Bug 13223: [QA Follow-up] Trivial change to one POD line 2014-11-19 13:28:23 -03:00
AuthUtils.pm Bug 9611: (follow-up) move new password hashing routines to separate module 2013-10-09 03:29:22 +00:00
Authority.pm Bug 5202: QA follow-up - correct license and POD errors 2013-10-10 21:39:15 +00:00
Cache.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Calendar.pm Bug 11634 [QA Followup] - Make unit tests pass 2014-11-12 14:56:41 -03:00
Database.pm Bug 13645: Cache the DBIx connection 2015-03-11 07:56:01 +13:00
DateUtils.pm Bug 12669: Centralize the timezone handle into Koha::DateUtils 2015-02-23 12:06:38 +13:00
Email.pm Bug 9530: Adding a new Koha::Email module 2014-10-27 10:38:14 -03:00
I18N.pm Bug 11848: (follow-up) update license statment 2014-05-05 04:51:42 +00:00
Linktracker.pm Bug 8917 : [ Sign followup ] Track clicks to links external to Koha 2013-03-07 11:14:25 -05:00
MetadataRecord.pm Bug 9755 QA follow-up: move MARC-specific functionality to utility class 2013-07-23 23:10:21 +00:00
NorwegianPatronDB.pm Bug 14403: Remove warn in Koha::NorwegianPatronDB 2015-07-05 02:22:27 +00:00
Plugins.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
RecordProcessor.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Schema.pm Bug 11891: (follow-up) remove custom storage class 2014-06-19 11:55:03 -03:00
SimpleMARC.pm Bug 11413: Fix field_numbers 2014-11-14 12:05:47 -03:00
SuggestionEngine.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
XSLT_Handler.pm Bug 11826: (follow-up) run perltidy on Koha/XSLT_Handler.pm 2014-05-26 03:59:11 +00:00