KOHA
Zebra indexing: Revision 23


Zebra start i stop

mglavica@koha-upgrade:~$ sudo /usr/share/koha/bin/koha-zebra-ctl.sh start
Starting Zebra Server

mglavica@koha-upgrade:~$ sudo /usr/share/koha/bin/koha-zebra-ctl.sh stop
Stopping Zebra Server

Obnavljanje zapisa u indexu

Za to bi trebao služiti Zebraqueue Daemon, ali ne radi kako treba (koha-zebraqueue-ctl.sh). Umjesto toga index se rebuilda svako malo uz pomoć crona

Pokrenuti kao user koha.

KOHA_CONF=/etc/koha/koha-conf.xml
PERL5LIB=/usr/share/koha/lib

# m h  dom mon dow   command
*/4 * * * *   ps ax | grep -v grep | grep rebuild_zebra.pl || /srv/koha/misc/migration_tools/rebuild_zebra.pl -b -z >/dev/null

Dodavanje polja u pretraživanje

etc/zebradb/marc_defs/marc21/biblios/record.abs
mapping of MARC fields to indexes

etc/zebradb/biblios/etc/bib1.att
list of search indexes and their corresponding Z39.50 use attributes

etc/zebradb/ccl.properties
for searching purposes

UTF-8 to ASCII mappings

http://lists.indexdata.dk/pipermail/zebralist/2007-August/001707.html

Dijakritički znakovi

Situacija: u bazu su povučeni zapisi iz NSK (Voyager) u kojima su naša slova s dijaktiticima zabilježena kao dva znaka (slovo bez dijakritika + dijaktitik).

Nije lijepo da takvi znakovi završe u Koha bazi, ali kad su već unutra, treba ih nekako učiniti pretraživima.
U datoteku /etc/koha/zebradb/etc/word-phrase-utf.chr dodati ekvivalente:

git

# Characters to be considered equivalent for searching purposes
equivalent č(cˇ)
equivalent Č(Cˇ)
equivalent ć(c´)
equivalent Ć(C´)
equivalent š(sˇ)
equivalent Š(Sˇ)
equivalent ž(zˇ)
equivalent Ž(Zˇ)

Sad to dobro radi kad se pretražuje s "normalnim" znakovima. Ostaje problem kod browsanja preko liknova - strgani zapisi nađu samo strgane (pr. http://10.60.0.253/cgi-bin/koha/opac-detail.pl?biblionumber=241488, Pavao Pavličić).

Zebra register i shadow

Veličinu zebra register i shadow treba podesiti sukladno veličini baze. Za oko 120.000 zapisa, dovoljno je 4G. Za FF je sada podešeno 16GB.

Z39.50 server

Dokumentacija

Ali sve je uzalud jer je pravi odgovor na http://www.indexdata.com/zebra/doc/zebrasrv.html

The first two servers, "server1" and "server2", can be reached by both listener addresses - since no listenref attribute is specified.

Pravo rješenje

test-yaz-zebra.sh

Server

služi za razmjenu zapisa

Konfiguracija

Dodati novi public server prema uputama na http://wiki.koha-community.org/wiki/Troubleshooting_Koha_as_a_Z39.50_server

Dokumentacija

Najkorisnije:

Ostalo:

FFZG

yaz-client

dpavlin@koha-dev:~$ yaz-client 
Z> open localhost:9999/biblios
Connecting...OK.
Sent initrequest.
Connection accepted by v3 target.
ID     : 81
Name   : Zebra Information Server/GFS/YAZ
Version: 3.0.52 e687cb7eb87c841f0d1a374174d51d30371f2d97
Options: search present delSet triggerResourceCtrl scan sort extendedServices namedResultSets
Elapsed: 1.605266
Z> find human
Z> show 1
Z> quit
See you later, alligator.

Use Koha's CCL queries:

dpavlin@koha-dev:~$ yaz-client -c /etc/koha/zebradb/ccl.properties localhost:9999/biblios
Connecting...OK.
Sent initrequest.
Connection accepted by v3 target.
ID     : 81
Name   : Zebra Information Server/GFS/YAZ
Version: 4.1.7 c43e561fdfe12989a6040163dae0e28ba0a02453
Options: search present delSet triggerResourceCtrl scan sort extendedServices namedResultSets
Elapsed: 0.001445
Z> querytype ccl2rpn
Z> find (kw,wrdl,rtrn=human ) not Suppress=1
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 1935, setno 1
SearchResult-1: term=    human cnt=1935, term=    1 cnt=21
records returned: 0
Elapsed: 0.025643
Z> 

Debug Zebra problems

enable all logging

# add all to http://www.loc.gov/z3950/agency/defns/bib1diag.html
ZEBRAOPTIONS="-v none,fatal,warn,all"

dpavlin@koha-dev:~$ sudo /etc/init.d/koha-zebra-ctl.sh restart
Restarting the Zebra Server

dpavlin@koha-dev:~$ sudo tail -f /var/log/koha/koha-zebradaemon-output.log | grep ERROR
18:45:58-29/03 zebrasrv(1) 605aecf5 [request] Init ERROR 1011 ID:81 Name:ZOOM-C/YAZ Version:4.1.7 c43e561fdfe12989a6040163dae0e28ba0a02453

Lookup error codes at http://www.loc.gov/z3950/agency/defns/bib1diag.html