Searching for a barcode with the barcode only as a keyword doesn't find the record. When adding the prefix bc: before the barcode, the barcode is found. DOM indexing is activated in my installation.
(In reply to comment #0) > Searching for a barcode with the barcode only as a keyword doesn't find the > record. When adding the prefix bc: before the barcode, the barcode is found. > > DOM indexing is activated in my installation. Katrin, I am just confirming that your situation is the same as ours. On the staff 'Home' page, 'Search Catalog' input field. If just a barcode is entered, we get: No results match your search for 'kw,wrdl: 33529004102850'. I can successfully search for a barcode by entering bc:33529004102850 in the 'Search Catalog' or by going to the 'Advance Search' selecting Barcode from the dropdown keyword selection and entering the barcode in the search field. Jorge
We're also having this issue in a few places. It appears to be direclty related to DOM indexing. Martin
This is not a good fix but I replaced: if(not $index){ $index = 'kw'; } in Search.pm (around line 1182) with: if(not $index){ if($operand =~ m/[0-9]{14}/){ $index = 'bc'; }else{ $index = 'kw'; } } Our barcodes are 14 digits long, it tests for 14 digits and sets the index to 'bc' instead of 'kw' when no index was submitted. There is probably a way to fix this through the zebra configuration files but I don't understand them well enough to try it. Jorge
It seems the line "all any" in record.abs is not carried through to the dom xml and xsl files used. Another workaround to add barcode back in to the general search is to add the "any" index for the barcode in record.abs, re-generate the xml and xsl then rebuild the zebra indexes. So the line in record.abs: melm 952$p barcode,barcode:n becomes: melm 952$p barcode,barcode:n,any:w Then follow the wiki to remake xml and xsl (don't just copy/paste as the example is unimarc): http://wiki.koha-community.org/wiki/Switching_to_dom_indexing It still does not explain how other main fields are retrieved with "any" but have no explicit "any" index in record.abs, but at least it is not changing the code only to be changed back when fixed.
Created attachment 15164 [details] [review] Patch for barcode missing in keyword search. This patch was worked through with Ian Bays using his suggestion of adding barcode to the any index for searching. To test 1. A pre patch search from the standard search box (either staff client or opac) for a barcode will not yield results. 2.A post patch search from the standard search box (either staff client or opac) for a barcode should yield the single record as a result.
Created attachment 15293 [details] [review] Patch for barcode missing in keyword search. This patch was worked through with Ian Bays using his suggestion of adding barcode to the any index for searching. To test 1. A pre patch search from the standard search box (either staff client or opac) for a barcode will not yield results. 2.A post patch search from the standard search box (either staff client or opac) for a barcode should yield the single record as a result.
The new patch re-adds a line that got missed and caused issues in the original patch.
As an aside.. the patch I've created only patches the relevant files for MARC21.. though I imagine it's very simple to also patch the ones for UNIMARC.
Created attachment 15862 [details] [review] Bug 8620: Any index overfull in DOM configurations The Any index seems like it may have been having too many elements added to it. I don't understand how that is possible, but there you go. This patch tests the theory, by changing the way the Any index is populated. To test: 1) Apply patch. 2) Update the following two files: etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl 3) Reindex 4) Do a search that was previously failing.
Created attachment 15863 [details] [review] [SIGNED OFF] Bug 8620: Any index overfull in DOM configurations The Any index seems like it may have been having too many elements added to it. I don't understand how that is possible, but there you go. This patch tests the theory, by changing the way the Any index is populated. To test: 1) Apply patch. 2) Update the following two files: etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl 3) Reindex 4) Do a search that was previously failing. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Fixes the problem for me - formerly not working callnumbers and barcodes are now found in keyword (any) searches.
Martin or Ian, maybe you can test this patch on one of your installations too?
I'll also test this one tomorrow... would be nice to get the any index all working properly! Martin
In my testing, the bug appeared if the -x option to rebuild_zebra.pl was omitted -- i.e., searching by barcode-as-keyword didn't work then. If one of the affected records was reindexed with the -x option, it worked.
Created attachment 15869 [details] [review] Bug 8620: Any index in DOM mode sensitive to -x flag of rebuild_zebra.pl The definition of the Any index was sensitive to whether spaces were present between (say) subfield elements in the MARCXML representation of the bib being indexed. When using the -x option to rebuild_zebra.pl, spaces would be present because of how MARC::File::XML emits MARCXML. When not using the -x option, spaces would not be present and the contents of a field would be run together, potentially as one big token. The visible behavior was that doing a keyword search by item barcode would sometimes not work. To test: 0) Make sure Zebra is using DOM mode 1) Create an item record. 2) Reindex using rebuild_zebra.pl -b -z, *without* -x 3) Do a keyword search by the barcode of the item just added; the search shouldn't work 4) Apply patch. 5) Update the following two files: etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl 6) Reindex 7) Do a search that was previously failing. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Fixes the problem for me - formerly not working callnumbers and barcodes are now found in keyword (any) searches. Signed-off-by: Galen Charlton <gmc@esilibrary.com> (revised commit description to better explain why it fixes the problem)
I am inclined to pass this QA as we have another sign-off from Galen - RM?
Created attachment 15905 [details] [review] Bug 8620: Any index in DOM mode sensitive to -x flag of rebuild_zebra.pl Works as expected; Will be glad to see this get pushed.
Switching this to Passed QA.
This patch has been pushed to master.
Pushed to 3.10.x and 3.8.x will be in 3.10.4 and 3.8.11