When importing records, the ISBN is normalized and stored into database (see C4::Breeding::ImportBreeding). But when searching with ISBN into reservoir, it is not normalized (see C4::Breeding::BreedingSearch). So search does not match.
Created attachment 22956 [details] [review] Bug 11254 - breeding search must normalize ISBN See commit message
This eyeballs well, but step-by-step instructions would really help.
(In reply to M. Tompsett from comment #2) > This eyeballs well, but step-by-step instructions would really help. There is a test plan into patch comment : Subject: [PATCH] Bug 11254 - breeding search must normalize ISBN When importing records, the ISBN is normalized and stored into database (see C4::Breeding::ImportBreeding). But when searching with ISBN into reservoir, it is not normalized (see C4::Breeding::BreedingSearch). So search does not match. This patch adds the normalisation to breeding search. Also replaces call private method _isbn_cleanup by GetNormalizedISBN, the correct public method. Also allows the breeding search on ISBN with hyphens. Test plan : - Import a record with ISBN 13 with hyphens. ie 978-2-8153-0357-6 - Go to cataloguing : cataloguing/addbooks.pl - Enter ISBN 13 with hyphens. ie 978-2-8153-0357-6 => the imported record is found - Enter ISBN 13 without hyphens. ie 9782815303576 => the imported record is found - Enter normalized ISBN. ie 2815303574 => the imported record is found
Created attachment 24443 [details] MARC file of ISBN 978-0-12-345678-6 Sample data file that I used for testing. https://www.forewordreviews.com/reviews/the-little-book-of-string-theory/
I reset my data to several months ago, to make sure I didn't have the sample record I have attached. I did a staff client update. I imported the record, and added an item. I triggered a reindex: $ ./misc/migration_tools/rebuild_zebra.pl -b -a -z -v I went home, and clicked Cataloging to do a Cataloging Search. I searched for 9780691142890, and it didn't come up, except in the reservoir. I searched for 978-0-691-14289-0, and it came up in both the catalog and the reservoir. I went to the biblio record, and edited the record to not have hyphens in the ISBN (020$a). I triggered a reindex: $ ./misc/migration_tools/rebuild_zebra.pl -b -a -z -v I went home, and clicked Cataloging to do a Cataloging Search. I searched for 9780691142890, and it came up in both the catalog and the reservoir. I searched for 978-0-691-14289-0, and it didn't come up, except in the reservoir. Shouldn't it be coming up for both the reservoir and the catalog regardless of hypens?
(In reply to M. Tompsett from comment #5) > Shouldn't it be coming up for both the reservoir and the catalog regardless > of hypens? This behavior is enabled in catalog search by using UCI in Zebra indexation. But this patch modifies a behavior only for breeding/reservoir search, which uses SQL query, not the search engine.
Created attachment 24525 [details] [review] [SIGNED OFF] Bug 11254 - breeding search must normalize ISBN When importing records, the ISBN is normalized and stored into database (see C4::Breeding::ImportBreeding). But when searching with ISBN into reservoir, it is not normalized (see C4::Breeding::BreedingSearch). So search does not match. This patch adds the normalisation to breeding search. Also replaces call private method _isbn_cleanup by GetNormalizedISBN, the correct public method. Also allows the breeding search on ISBN with hyphens. This is intended to fix only reservoir searches. Revised Test plan ----------------- 1) Back up DB 2) Save copy of attached example somewhere findable 2) Home -> Tools -> Stage MARC records for import 3) Click Browse and select the example MARC file 4) Click Upload file 5) Tweak as desired then click Stage for import 6) Click Manage staged records 7) Click Import this batch into the catalog 8) Home -> Cataloging 9) In the Cataloging search text box type 978-0-691-14289-0 and click Submit -- ISBN13 with hypens not found in reservoir 10) In the Cataloging search text box type 9780691142890 and click Submit -- ISBN13 without hypens not found in reservoir 11) In the Cataloging search text box type 0-691-14289-0 and click Submit -- ISBN10 with hypens not found in reservoir 12) In the Cataloging search text box type 0691142890 and click Submit -- ISBN10 without hypens found in reservoir 13) Apply patch 14) Repeat steps 9-12, this time it is always found! :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Vast improvement on reservoir searches by ISBN!
Created attachment 24527 [details] [review] Bug 11254 - breeding search must normalize ISBN When importing records, the ISBN is normalized and stored into database (see C4::Breeding::ImportBreeding). But when searching with ISBN into reservoir, it is not normalized (see C4::Breeding::BreedingSearch). So search does not match. This patch adds the normalisation to breeding search. Also replaces call private method _isbn_cleanup by GetNormalizedISBN, the correct public method. Also allows the breeding search on ISBN with hyphens. This is intended to fix only reservoir searches. Revised Test plan ----------------- 1) Back up DB 2) Save copy of attached example somewhere findable 2) Home -> Tools -> Stage MARC records for import 3) Click Browse and select the example MARC file 4) Click Upload file 5) Tweak as desired then click Stage for import 6) Click Manage staged records 7) Click Import this batch into the catalog 8) Home -> Cataloging 9) In the Cataloging search text box type 978-0-691-14289-0 and click Submit -- ISBN13 with hypens not found in reservoir 10) In the Cataloging search text box type 9780691142890 and click Submit -- ISBN13 without hypens not found in reservoir 11) In the Cataloging search text box type 0-691-14289-0 and click Submit -- ISBN10 with hypens not found in reservoir 12) In the Cataloging search text box type 0691142890 and click Submit -- ISBN10 without hypens found in reservoir 13) Apply patch 14) Repeat steps 9-12, this time it is always found! :) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master. Thanks, Fridolin!
Pushed to 3.14.x, will be in 3.14.10
Picked for 3.12.15!