[Koha] Mapping MARC21 to Advanced Search
Barton Chittenden
barton at bywatersolutions.com
Wed Aug 15 01:48:18 NZST 2018
On Mon, Aug 13, 2018 at 9:52 AM, Caroline Cyr-La-Rose <
caroline.cyr-la-rose at inlibro.com> wrote:
>
> In the manual, there is a kind of mapping section for searches that gives
> you the indexes for each marc field: https://koha-community.org/man
> ual/18.05/en/html/searching.html#koha-search-indexes
If you want to see where the actual mapping between marc tags and zebra
index definitions occurs, take a look at the *-koha-indexdefs.xml files.
./normarc/biblios/biblio-koha-indexdefs.xml
./marc21/authorities/authority-koha-indexdefs.xml
./marc21/biblios/biblio-koha-indexdefs.xml
./unimarc/authorities/authority-koha-indexdefs.xml
./unimarc/biblios/biblio-koha-indexdefs.xml
Here's a snippit of biblio-koha-indexdefs.xml for marc21 -- 245$a has the
zebra indexes Title-cover:w, Title-cover:p, Title-cover:s, Title:w
and Title:p.
The part after the colon is the index type - w for 'word', p for 'phrase'
and ... I'm not sure what s is (my guess is 'exact *S*tring').
<index_subfields tag="245" subfields="a">
<target_index>Title-cover:w</target_index>
<target_index>Title-cover:p</target_index>
<target_index>Title-cover:s</target_index>
<target_index>Title:w</target_index>
<target_index>Title:p</target_index>
</index_subfields>
<!--record.abs line 114: melm 245$c
Author,Author-in-order:w,Author-in-order:p,Author-in-order:s-->
<index_subfields tag="245" subfields="c">
<target_index>Author:w</target_index>
<target_index>Author-in-order:w</target_index>
<target_index>Author-in-order:p</target_index>
<target_index>Author-in-order:s</target_index>
</index_subfields>
(Here's a link to that file in the koha git repository:
http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml;h=b3b12a0e2b12239c35a671325407a73e5db364e9;hb=HEAD
)
That's only half of the story, because Koha doesn't use the raw zebra
indexes... it actually uses the ccl.properties file for the indexes that
you see in the url... for instance, here's the entry in ccl.properties for
'author':
Author 1=1003 s=pw
au Author
The first line has the zebra index definition as well as the bib-1
attribute (used in z39.50). The second line is creating the alias 'au' for
Author.
so, when you look at the url for an author search, you'll see something
like idx=au,phr
... to trace that back to the indexdefs, you would look up "au" and "phr"
in ccl.properties, find the zebra index name there, and then back up to
the indexdefs.xml file.
That's not the whole story, but it's enough for most cases.
--Barton
More information about the Koha
mailing list