I know that anyone can add indexes and matching rules, but recently we have gotten many more libraries asking for indexes and matching rules on OCLC number (Marc21 035). This enhancement request is me asking if we could get these added in as defaults.
Created attachment 29591 [details] [review] Bug 6499 - OCLC # Indexing & Matching etc/zebradb/marc_defs/marc21/biblios/record.abs Add 035$a, 035$z and 035 as zebra index 'OCLC-Number' etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml Add 035$a, 035$z and 035 as zebra index 'OCLC-Number' Note that all changes were made via make_zebra_dom_cfg_from_record_abs; these changes were merged with the existing biblio-koha-indexdefs.xml. All changes in the file are a) logic adding OCLC-Number as a zebra index or b) Updates to line numbers in comments reflecting the current record.abs. All other changes made by make_zebra_dom_cfg_from_record_abs were discarded. See http://wiki.koha-community.org/wiki/MRenvoize/zebra#DOM_indexing. etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl Reflects changes made by applying koha-indexdefs-to-zebra.xsl to biblio-koha-indexdefs.xml. C4/Search.pm Add OCLC-Number to getIndexes() etc/zebradb/ccl.properties Set OCLC-Number 1=1211
Testing: 1) Make sure that you have a bib that has MARC21 035$a (and possibly also 035$z) populated. 2) Rebuild zebra: misc/migration_tools/rebuild_zebra.pl -x -b -z 3) Add the following to the intranetuserjs syspref: $(document).ready(function(){ // Add OCLC Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="OCLC_Number,w">OCLC Number</option>'); } } Do an advanced search, select OCLC Number from the search menu, then add the OCLC Number in 035$a for the bib specified in step 1. The advanced search should return that biblio record.
Hm, I am not happy with naming this index oclc-number - 035 is not only the OCLC number, although it can contain one. For example in our database one 035 always contains the PPN - the unique identifier from our union catalog SWB. 035 A control number of a system other than the one whose control number is contained in field 001 (Control Number), field 010 (Library of Congress Control Number) or field 016 (National Bibliographic Agency Control Number). (Repeatable) [a,z,6,8]
I think a better name might be other-control-number?
Created attachment 29605 [details] [review] Change zebra index "OCLC-Number" to "Other-control-number"
Updated test procedure. After patch is applied: 1) Make sure that you have a bib that has MARC21 035$a (and possibly also 035$z) populated. 2) Rebuild zebra: misc/migration_tools/rebuild_zebra.pl -x -b -z 3) Add the following to the intranetuserjs syspref: $(document).ready(function(){ // Add Other Control Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="Other-control-number,w">Other Control Number</option>'); } } Do an advanced search, select "Other Control Number" from the search menu, then add the Other Control Number in 035$a for the bib specified in step 1. The advanced search should return that biblio record.
Changed title of bug to remove pesky '#' character, and to better classify the change being made.
Created attachment 36104 [details] [review] Add Zebra index "Other-control-number" covering MARC21 035$a, 035$z and 035 (entire tag)
Updated test procedure. After patch is applied: 1) Make sure that you have a bib that has MARC21 035$a (and possibly also 035$z) populated. 2) Rebuild zebra: misc/migration_tools/rebuild_zebra.pl -x -b -z 3) Add the following to the intranetuserjs syspref: $(document).ready(function(){ // Add Other Control Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="Other-control-number">Other Control Number</option>'); } } Do an advanced search, select "Other Control Number" from the search menu, then add the Other Control Number in 035$a for the bib specified in step 1. The advanced search should return that biblio record.
Katrin, I've cleaned up the patch, and updated the testing procedures (minor change to javascript in the test procedure). The patch should apply to MASTER.
Created attachment 36105 [details] [review] Add Zebra index "Other-control-number" covering MARC21 035$a, 035$z and 035 (entire tag) http://bugs.koha-community.org/show_bug.cgi?id=6499 Signed-off-by: Nick <nick@quecheelibrary.org>
I am not able to spot the problem in the filess, but it doesn't work for me. I have: - copied all the index related files to my koha-dev folder - restarted zebra - done a full reindex I am puzzled. I am going to fail this for now, but would be happy if someone else tested if it works for them.
Katrin, about.pl on the koha installation that I was using lists Zebra version: Zebra 2.0.55 (C) 1994-2013, Index Data ApS Zebra is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. SHA1 ID: bd2bc9360225e695bbaba2c2d1cd6925c4eb23a5 Using ICU Could this be an issue of zebra version? Nick, Could you check Main->About on your test machine, and report the zebra version that worked for you? [Zebra version is the last item on the 'about' page] Thanks, --Barton
Katrin, I ran the following in yaz-client: yaz-client -c etc/zebradb/ccl.properties unix:/home/barton/koha-dev/var/run/zebradb/bibliosocket Connecting...OK. Sent initrequest. Connection accepted by v3 target. ID : 81 Name : Zebra Information Server/GFS/YAZ Version: 2.0.55/4.2.69 026ad3d737be4cbba4e98c6b6dc753f8029e3655 Options: search present delSet triggerResourceCtrl scan sort extendedServices namedResultSets Elapsed: 0.002972 Z> base biblios Z> scan @attr 1=1211 ocm03545607 query: @attr 1=1211 ocm03545607 Received ScanResponse 5 entries, position=1 Scan returned code 5 * ocm03545607 (1) ocm05041760 (1) ocm06098807 (1) OCoLC (4) VOY12798 (1) Elapsed: 0.071230 Z> --- Do you get errors when you run the following commands in yaz-client? base biblios scan @attr 1=1211 <your value in 035$a>
I tested successfully on a clean branch again today using kohadevbox, zebra version: Zebra 2.0.60 (C) 1994-2015, Index Data Zebra is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. SHA1 ID: b51184e7cf9eabd2c609f50f721d6568351fbc33 Using ICU Just to note, the js is missing closing ");" and should be $(document).ready(function(){ // Add Other Control Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="Other-control-number">Other Control Number</option>'); } });
Notes for Katrin and/or other QA: Nick Clemens tested this successfully on a clean kohadevbox install; noted that the javascript in my test procedure was missing the closing ");" I have seen issues recently where 'gitify' does not take into account the fact that $KOHA_CONF needs to point to an instance specific version of zebra-biblios-dom.cfg -- it stays pointed to the package version, which has the wrong profilePath. This will cause any changes made to DOM indexes to be ignored... so before testing, you might want to do the following: * grep zebra-biblios-dom.cfg $KOHA_CONF This will show you the path to zebra-biblios-dom.cfg. * grep profilePath [PATH TO zebra-biblios-dom.cfg]/zebra-biblios-dom.cfg If profilePath does not include your git directory (e.g. kohaclone), your tests will fail. Here's an updated test procedure, including the corrected javascript. 1) Apply patch 2) Make sure that you have a bib that has MARC21 035$a (and possibly also 035$z) populated. 3) Rebuild zebra: misc/migration_tools/rebuild_zebra.pl -x -b -z 4) Add the following to the intranetuserjs syspref: $(document).ready(function(){ // Add Other Control Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="Other-control-number">Other Control Number</option>'); } }); 5) Do an advanced search, select "Other Control Number" from the search menu, then add the Other Control Number in 035$a for the bib specified in step 1. The advanced search should return that biblio record.
Created attachment 39099 [details] [review] [SIGNED-OFF] Bug 6499: Add Zebra index "Other-control-number" covering MARC21 035$a, 035$z and 035 (entire tag) 1) Apply patch 2) Make sure that you have a bib that has MARC21 035$a (and possibly also 035$z) populated. pre 3) Replace all modified zebra files and restart zebra server 3) Rebuild zebra: misc/migration_tools/rebuild_zebra.pl -x -b -z 4) Add the following to the intranetuserjs syspref: $(document).ready(function(){ // Add Other Control Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="Other-control-number">Other Control Number</option>'); } }); 5) Do an advanced search, select "Other Control Number" from the search menu, then add the Other Control Number in 035$a for the bib specified in step 1. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works, no koha-qa errors
Created attachment 41710 [details] [review] Bug 6499: Add Zebra index "Other-control-number" covering MARC21 035$a, 035$z and 035 (entire tag) 1) Apply patch 2) Make sure that you have a bib that has MARC21 035$a (and possibly also 035$z) populated. pre 3) Replace all modified zebra files and restart zebra server 3) Rebuild zebra: misc/migration_tools/rebuild_zebra.pl -x -b -z 4) Add the following to the intranetuserjs syspref: $(document).ready(function(){ // Add Other Control Number to advanced search if (window.location.href.indexOf("catalogue/search.pl") > -1) { $(".advsearch").append('<option value="Other-control-number">Other Control Number</option>'); } }); 5) Do an advanced search, select "Other Control Number" from the search menu, then add the Other Control Number in 035$a for the bib specified in step 1. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works, no koha-qa errors Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 41711 [details] [review] Bug 6499: [QA Follow-up] Trivial adjustments Removes commented line from bib1.att. Adjust OCLC-number to Other-control-number in comment of ccl properties. No need to explicitly add 035$a and $z if you index 035 completely in record.abs as well as biblio-koha-indexdefs.xml. Rerun koha-indexdefs-to-zebra.xsl on index defs. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
QA Comment: Works for me, added a followup. The test plan includes an addition to intranetuserjs to use this field. But many users will miss that of course. If you really would need it in the menu, you could do that on a separate report. Full-text search will find it too of course now. Instead of Other-control-number perhaps System-control-number would still have been closer to the LOC naming :) No problem for me. Passed QA
Barton, there is no need to touch record.abs (not blocker) but you are missing the queryparser.yaml file in your patchset.
*** Bug 16986 has been marked as a duplicate of this bug. ***
The QueryParser configuration file has diverged and shouldn't be a blocker for this one IMHO.
Pushed to master for 16.11, thanks Barton, Marcel!
Pushed in 16.05. Will be in 16.05.03.
FYI, in our Koha instance (17.11.04) I had to use this in IntranetUserJS: <option value="Other-control-number,phr"> Instead of this: <option value="Other-control-number"> Without ",phr" I found it was doing a ",wrdl" search which failed. Others may find that this is not necessary, but I mention it here for anyone who stumbles upon this only to find that the suggested code doesn't work for them.