As I said in the previous post related to koha search system things are a bit more complicated than you might assume as someone using sql queries to do a search. Everything is done in Zebra and Zebra is a matter of indices.

So where is MARC?

Actually there are 3 files which should interest you:

  • koha/etc/zebradb/biblios/etc/bib1.att which defines the list of possible Z39.50 attributes. This is definition of names, it does not means all are used.
  • koha/etc/zebradb/marc_defs/marc21/biblios/record.abs which actually does the mapping from MARC fields to Z39.50 attributes
  • koha/etc/zebradb/ccl.properties which maps ccl names to bib1.att attributes

There is a more detailed description of these files on koha site but it forgets to mention the most important part: the name of these files :)

Let’s add a new index

Actually just enable an index, the 1036 which should allow the following search to work:

Author-Title-Subject,wrdl=marketing

These are the steps to take:

  • verify the index is defined in bib1.att
att 1036    Author-Title-Subject
  • decomment it in ccl.properties
#Author-Title-Subject 1036  An author or a title or a        1XX, 2XX, 4XX,
#                           subject.                         6XX, 7XX, 8XX
#
#            Note: When the Use attribute is Author-name-and-title (1000)
#            the term contains both an author name and a title.  When the
#            Use attribute is Author-Title-Subject (1036), the term
#            contains an author name or a title or a subject.
Author-Title-Subject 1=1036
  • add the index name in record.abs for each of the MARC fields above. For example:
melm 100        Author,Author-title,Author-name-personal,Name,Name-and-title,Personal-name,Author-Title-Subject
melm 110$9      Koha-Auth-Number
melm 110        Author,Author-title,Author-name-corporate,Name,Name-and-title,Corporate-name,Author-Title-Subject
melm 111$9      Koha-Auth-Number
melm 111        Author,Author-title,Author-name-corporate,Name,Name-and-title,Conference-name,Author-Title-Subject
...
  • reindex your zebra
koha/bin/migration_tools/rebuild_zebra.pl -b -a -r

Done, now you can use this new search in your OPAC or librarian interface, you could add a new option in the select combo for example.

Comments:

barton -

This is a great post; I think that it ties together the zebra index, the Z39.50 attributes used by PQF and ccl.properties. Please be aware that GRS1 search, and the associated configuration file record.abs are deprecated in Koha. Koha now uses DOM indexing, configured through biblio-koha-indexdefs.xml


Tudor -

I have no clue about programming, but re-indexing your zebra sounds like a lot of fun :)


Celuloza si Hirtie -

Thank you Len for posting very nice simple explanation of KOHA-Yaz-Zebra configuration and files otherwise very difficult to find anywhere else on the web.


joachla -

is this right: You don’t have to configure Zebra, if the descriptions in ccl.properties are right, and to change is simply decomment needed lines, more work would be to change or put away some marc21-data-fields from search, what means (in rebuild_zebra.pl ) –b, -a and –r?


len -

Hi joachla, I don’t quite understand your question, could you re-phrase? As for the rebuild_zebra parameters do a -h for full details.


joachla -

I installed Koha from the liblive.cd (ARD Prasad), one point was, install Zebra or NoZebra, and as I selected Zebra, the CD said “be conscious, that You have to configure Zebra”, but now I know, that there seem to be no problems, nothing to configure, because the configuration file is ccl.properties, and in this file everything is, how I want, Koha-program works, —(if I understood everything right—), for example it says (in ccl.properties): #Abstract 62 An abbreviated, accurate 520 # representation of a work, # usually without added # interpretation or criticism. Abstract 1=62 ab Abstract so I know, I have to put possible descriptions/abstracts of the books into the marc-field-number-520 and, except -searches, nothing searches this field, except /-searches, (—if I’m, right) only, If I want more detailed search, I have to change whatever (in bib1.att and record.abs), another point is, in this liblive.cd, change Koha admin Login, Koha admin password, password for dspace, Login for mysql admin user, Password for mysql, login and password for Squirrelmail, etc. etc. I don’t understand sorry for my English


joachla -

sorry: ….and, except “any”-searches, nothing searches this field, except “ab”/“Abstract”-searches…


len -

@joachla You are right, there is nothing to configure by default. The default configuration already provides the basic search functionality which is implemented using the Zebra indexes. Zebra indexes are defined in the ccl.properties file and the association of which marc field goes into which index is found in record.abs. The only thing to configure if you need only the default functionality is the cron job to recreate/update the indexes from Zebra. As for the liblive.cd this I cannot answer, I’ve installed Koha from the tar archive.


joachla -

I have to reindex Zebra (with rebuild_zebra.pl ?), doesn’t it work automatically?


joachla -

(I have to reindex Zebra) …only if I changed the Zebra-configuration


len -

@joachla You have to rebuild the index each time you changed something in koha: biblios or authorities. Normaly you schedule a cron job to do that for you. The rebuild_zebra has an option to reindex only the changes.


joachla -

I cannot stop zebraqueue_daemon.pl, and know not, how to start rebuild_zebra.pl, and if I could ask via email answer