https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15541
Alex Buckley <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57852|0 |1 is obsolete| | --- Comment #34 from Alex Buckley <[email protected]> --- Created attachment 59295 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59295&action=edit Bug 15541 - Prevent normalization during matching/import process This patch allows you to use the "qualifier,qualifier" syntax in the Record Matching Rules "Search Index" when using the QueryParser. While QueryParser doesn't support this syntax, it will now fallback correctly to non-QueryParser functionality. Without the patch, your search will just fail silently. This patch also adds a "skip_normalize" option to C4::Search::SimpleSearch(), and uses the option during C4::Matcher::get_matches. This prevents the s/:/=/g and s/=/:/g normalization. This normalization is heavy-handed, and while it is necessary sometimes to generate a valid CCL query or QueryParser query, C4::Matcher::get_matches() already produces a valid CCL query, so we don't need to do this normalization. Additionally, this normalization causes problems when you use a Zebra register which isn't normalized: namely the "u" register. Strings are stored "as is", so http://localhost/koha/resource/1 is stored as is during indexing. When you search, you need to pass the exact same thing through the query to get a match. Using http=//localhost/koha/resource/1 in your query will yield zero results. _TEST PLAN_ 0) Apply patch 1) Create a Record Matching Rule in Koha with the following details: Matching rule code: TEST Description: Test Match threshold: 100 Record type: Bibliographic Match point 1: Search index: id-other,st-urx Score: 100 Tag: 024 Subfields: a Normalization rule: None 2) Create a record in Koha with an indexable URI 2a) Default framework 2b) 024 $a http://koha-community.org/test $2 uri 2c) 040 $c test 2d) 245 $a This is a test record 2e) 942 $c Books 2f) Save (save again if cautioned about missing fields as these should autofill) 3) Do a full re-index of Zebra 4) Download your record from Koha as a .mrc file (ie isomarc, binary marc, etc) 5) Go to "Stage MARC records for import" 5a) Upload your .marc file. 5b) Change your "Record matching rule" to "Test" 5c) Click Stage for import 9) It should say "1 records with at least one match in catalog per matching rule "Test". NOTE: For completeness, you can go through this process on a clean master branch, and note that it will say '0 records with at least one match in catalog per matching rule "TEST"' Signed-off-by: Alex Buckley <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
