Date entered on file is in MARC21 tag 008 position 00 to 05 (or 1-6 for normal humans). In Koha only the first 5 digits are indexed with Zebra. Does not really facilitate searching ;) <index_control_field tag="008" offset="0" length="5"> <target_index>date-entered-on-file:n</target_index> </index_control_field> <index_control_field tag="008" offset="0" length="5"> <target_index>date-entered-on-file:s</target_index> </index_control_field> <xslo:template match="marc:controlfield[@tag='008']"> <z:index name="date-entered-on-file:n"> <xslo:value-of select="substring(., 1, 5)"/> </z:index> <z:index name="date-entered-on-file:s"> <xslo:value-of select="substring(., 1, 5)"/> </z:index> Elasticsearch appears to do a better job: date-entered-on-file: label: date-entered-on-file mappings: - facet: '' marc_field: '008_/0-5' marc_type: marc21 sort: ~ suggestible: '' - facet: '' marc_field: '008_/0-5' marc_type: normarc sort: ~ suggestible: ''
Just bumped into this one. Fun times [U+1F923]
Couldn't recall if we just update the XML or also the XSLT, so I'll do two separate patches. This is how I generated the XSLT though: xsltproc ./etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml > ./etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
Test plan: Before applying patch... 1. yaz-client unix:/var/run/koha/kohadev/bibliosocket 2. base biblios 3. querytype ccl2rpn 4. set_cclfile /etc/koha/zebradb/ccl.properties 5. find date-entered-on-file,st-numeric < 23000 6. format xml 7. elements zebra::snippet 8. show 1 9. Note that only 5 digits appear in the "date-entered-on-file" snippet (e.g. 12082) -- Apply the patch 0a. cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl 0b. koha-rebuild-zebra -b -f -v kohadev 1. yaz-client unix:/var/run/koha/kohadev/bibliosocket 2. base biblios 3. querytype ccl2rpn 4. set_cclfile /etc/koha/zebradb/ccl.properties 5. find date-entered-on-file,st-numeric < 230000 6. format xml 7. elements zebra::snippet 8. show 1 9. Note that 6 digits appear in the "date-entered-on-file" snippet (e.g. 120829)
Created attachment 152071 [details] [review] Bug 24517: Add missing 6th position to date-entered-on-file index
Created attachment 152072 [details] [review] Bug 24517: Add missing 6th position to date-entered-on-file index (XSLT)
Created attachment 152223 [details] [review] Bug 24517: Add missing 6th position to date-entered-on-file index Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 152224 [details] [review] Bug 24517: Add missing 6th position to date-entered-on-file index (XSLT) Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
- <index_control_field tag="008" offset="0" length="5"> + <index_control_field tag="008" offset="0" length="6"> - <xslo:value-of select="substring(., 1, 5)"/> + <xslo:value-of select="substring(., 1, 6)"/> This is ok. Just confusing that XSLT substring starts with 1 while we use offset with zero..
Created attachment 152621 [details] [review] Bug 24517: Add missing 6th position to date-entered-on-file index Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Adding the biblio-zebra-indexdefs.xsl on same patch (as should be generated with xsltproc).
Pushed to master for 23.11. Nice work everyone, thanks!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to 22.11.x for next release