Bug 14472 - Wrong ISSN search index in record matching rules
Summary: Wrong ISSN search index in record matching rules
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Amit Gupta
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-29 16:03 UTC by Amit Gupta
Modified: 2016-06-21 21:40 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Wrong search index (47.69 KB, image/png)
2015-06-29 16:03 UTC, Amit Gupta
Details
Wrong search index (36.16 KB, image/png)
2015-06-29 16:04 UTC, Amit Gupta
Details
Bug 14472 - Wrong ISSN search index in record matching rules (914 bytes, patch)
2015-06-29 16:17 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 14472 - Wrong ISSN search index in record matching rules (11.39 KB, patch)
2015-06-29 16:18 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 14472 - Squashed Wrong ISSN search index in matching rules (12.13 KB, patch)
2015-07-06 03:38 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 14472 - Wrong ISSN search index in record matching rules (12.13 KB, patch)
2015-07-08 16:34 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 14472 - Wrong ISSN search index in record matching rules (12.35 KB, patch)
2015-09-03 02:58 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 14472 - Wrong ISSN search index in record matching rules (12.42 KB, patch)
2015-09-03 08:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14472: (follow-up) Wrong ISSN search index in record matching rules (3.94 KB, patch)
2015-09-03 08:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14472: (QA followup) fix updatedatabase.pl for multiple ISSN rules (1.31 KB, patch)
2015-09-18 15:47 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Gupta 2015-06-29 16:03:48 UTC
Created attachment 40721 [details]
Wrong search index

Wrong ISSN search index in record matching rules.

Currently ISSN record matching rules using "isbn" search index. 

Result:

1) Not able to upload records via 022$a (ISSN) matching rule.
Comment 1 Amit Gupta 2015-06-29 16:04:24 UTC
Created attachment 40722 [details]
Wrong search index
Comment 2 Amit Gupta 2015-06-29 16:17:55 UTC Comment hidden (obsolete)
Comment 3 Amit Gupta 2015-06-29 16:18:45 UTC Comment hidden (obsolete)
Comment 4 Indranil Das Gupta 2015-07-05 21:33:11 UTC
Comment on attachment 40724 [details] [review]
Bug 14472 - Wrong ISSN search index in record matching  rules

Review of attachment 40724 [details] [review]:
-----------------------------------------------------------------

Hi Amit,
You may want to squash these two commits into one. Makes little sense to have a separate one-line commit.
-idg
Comment 5 Amit Gupta 2015-07-06 03:38:37 UTC Comment hidden (obsolete)
Comment 6 Mark Tompsett 2015-07-08 14:55:21 UTC
> UPDATE matchpoints SET search_index = 'issn' WHERE matcher_id = 2;

How do you know the matcher_id is 2 for everyone?
Your fresh install modifications change isbn to issn, is that correct?
Comment 7 Amit Gupta 2015-07-08 15:57:32 UTC
Hi Mark,

Thanks for comments

>How do you know the matcher_id is 2 for everyone?
Yes you are right matcher_id is 2 not for everyone. 

-------------------------------------------------------
update marc_matchers set search_index ='issn' where matcher_id = (select matcher_id from marc_matchers where code = 'ISSN');
-------------------------------------------------------

>Your fresh install modifications change isbn to issn, is that correct?

Currently if you upload MARC records using "ISSN(022$a)" record matching rule. It will not match any record due to wrong search index.

After applying this patch the incoming records should match perfectly using ("ISSN(022$a)" record matching rule).

Will resend patch again.
Comment 8 Amit Gupta 2015-07-08 16:12:29 UTC
correct sql
--------------------
UPDATE matchpoints SET search_index ='issn' where matcher_id = (SELECT matcher_id FROM marc_matchers WHERE code = 'ISSN');
Comment 9 Amit Gupta 2015-07-08 16:34:10 UTC Comment hidden (obsolete)
Comment 10 Chris Cormack 2015-09-03 02:58:07 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2015-09-03 08:54:43 UTC
Created attachment 42275 [details] [review]
Bug 14472 - Wrong ISSN search index in record matching rules

To Test
---------
 1) Apply the patch
 2) Export some MARC bibliographic records from Koha
 3) Import those same MARC bibliographic records using the
    "ISSN(022$a)" record matching rule.
 4) The incoming records should match perfectly
 5) Check the mysql tables (marc_matchers, matchpoints,
    matcher_matchpoints, matchpoint_components,
    matchpoint_component_norms) to make sure the values were
    inserted as expected.
For new Koha installation
 1) create the koha database
 2) Go to the staff client page, and do a "fresh" install making
    sure to select lots of optional marc 21 matching rules so
    the .../marc21/optional/marc21_default_matching_rules.sql
    gets triggered.
 3) Check the mysql tables (marc_matchers, matchpoints,
    matcher_matchpoints, matchpoint_components,
    matchpoint_component_norms) to make sure the values were
    inserted as expected.

Bug 14472 - Added Atomic Update to fix wrong issn search index

    - Fix comments

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2015-09-03 08:54:48 UTC
Created attachment 42276 [details] [review]
Bug 14472: (follow-up) Wrong ISSN search index in record matching rules

Follow-up for
- it-IT unimarc
- ru-RU unimarc
- uk-UA unimarc

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2015-09-03 08:55:25 UTC
Note that this file does not exist for fr-FR unimarc.
Comment 14 Tomás Cohen Arazi 2015-09-07 14:57:26 UTC
Patches pushed to master.

Thanks Amit!
Comment 15 Tomás Cohen Arazi 2015-09-18 15:47:32 UTC
Created attachment 42710 [details] [review]
Bug 14472: (QA followup) fix updatedatabase.pl for multiple ISSN rules

If (for some reason) the user has created more than one matching rule
with the 'ISSN' code, the updatedabase.pl script fails, because it was
written with the default data in mind, and didn't consider the scenario
described above.

Thanks Liz for pointing this out!

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>