Koha/etc/zebradb
Tomas Cohen Arazi 5ef1b6710e Bug 18098: Add an index with the count of not onloan items
This patch adds a numeric index 'not-onloan-count' containing the value
of 999$x. This subfield is filled by 'rebuild_zebra.pl' by making use of
(bug's 18208) 'EmbedItemsAvailability' filter.

bib1.att and indexes definitions are updated accordingly.

To test:
- Apply the patch
- Pick the right biblio-zebra-indexdefs.xsl file for your setup and
  replace the one your Zebra uses [1]
- Replace your bib1.att
- Replace your ccl.properties
- Have at least one record with more than one item, checkout some
  item(s) from that record(s).
- Rebuild zebra's indexes:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/migration_tools/rebuild_zebra.pl -r -b -v -k
 (notice the dump directory is kept, you can try the XSLT yourself
  running:
    $ xsltproc \
       etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \
       /tmp/the_dump_dir/biblios/exported_records | less
=> SUCCESS: There are records with the not-onloan-count index, and the
            value is correct!
- Check Zebra yourself:
  $ yaz-client unix:/var/run/koha/kohadev/bibliosocket
 Z> base biblios
 Z> find @attr 1=9013 @attr 2=5 @attr 4=109 0
=> SUCCESS: The search matches the amount of records with not-onloan
            items.
 Z> s 1+1
=> SUCCESS: Records with 999$x having a value higher than 0 are rendered
- Sign off :-D

Note: While this work is complete on its purpose, it is part of an
attempt to create a better way of filtering by availability.

Sponsored-by: ByWater Solutions

 [1] In kohadevbox this would be
/etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl

Edit: Added the missing XSLT changes for UNIMARC and NORMARC

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-05-08 09:21:41 -04:00
..
authorities/etc Bug 9612: (follow-up) restore elementSetName in Context.pm 2014-05-19 16:46:57 +00:00
biblios/etc Bug 18098: Add an index with the count of not onloan items 2017-05-08 09:21:41 -04:00
etc Bug 14542: Transliterate rule for all single quote forms 2015-11-16 15:45:21 -03:00
lang_defs Bug 16952: Czech language definitions for sorting in Zebra 2016-10-28 15:33:00 +00:00
marc_defs Bug 18098: Add an index with the count of not onloan items 2017-05-08 09:21:41 -04:00
xsl Bug 14332: Skip articles in MARC21 using indicator n.2 of field 245 2016-01-27 06:17:16 +00:00
ccl.properties Bug 18098: Add an index with the count of not onloan items 2017-05-08 09:21:41 -04:00
cql.properties
explain-authorities.xml
explain-biblios.xml
pqf.properties
retrieval-info-auth-dom.xml Bug 9612: fix SRU response for DOM indexing 2014-05-05 20:28:04 +00:00
retrieval-info-auth-grs1.xml Bug 3087 Fix Z39.50 server to return the correct record syntax 2012-10-22 14:12:22 +02:00
retrieval-info-bib-dom.xml Bug 17871: Remove zebra::snippet to allow access to facets in YAZ 5.8.1+ 2017-02-07 17:50:42 +00:00
retrieval-info-bib-grs1.xml Bug 3087 Fix Z39.50 server to return the correct record syntax 2012-10-22 14:12:22 +02:00
zebra-authorities-dom.cfg Bug 17035 - Koha allows system-wide 'read' access to all Koha zebra databases, by default 2016-10-10 12:20:12 +00:00
zebra-authorities.cfg Bug 17035 - Koha allows system-wide 'read' access to all Koha zebra databases, by default 2016-10-10 12:20:12 +00:00
zebra-biblios-dom.cfg Bug 17035 - Koha allows system-wide 'read' access to all Koha zebra databases, by default 2016-10-10 12:20:12 +00:00
zebra-biblios.cfg Bug 17035 - Koha allows system-wide 'read' access to all Koha zebra databases, by default 2016-10-10 12:20:12 +00:00