From a74454a21893ae001db04ff74a48e9dda651462b Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Mon, 1 Sep 2014 23:33:49 +0200 Subject: [PATCH 3/3] Add a new XSLT template for indexing goup of subfields as a whole Content-Type: text/plain; charset="utf-8" This patch adds a new template in koha-indexdefs-to-zebra.xsl in order to index a specific goup of subfields as a whole. It can be used for indexing as a "phrase" a string resulting from the concatenation of some indexes (with a space between them) To use this new template, use the new "index_group_of_subfields" element in biblio-koha-indexdefs.xml, in the same way you used index_subfields Ex : to index the concatenation of "$a $b $d $g" subfields of 700 UNIMARC field in Author:p and Personal-name:p Author:p Personal-name:p This patch also change the biblio-koha-indexdefs.xml and biblio-zebra-indexdefs.xsl for UNIMARC in order to index the "$a $b $d $g" of 700 UNIMARC field in Author:p and Personal-name:p as explained in the example before To test : in a DOM UNIMARC Koha, apply all the patches, copy the modified files in your Zebra configuration directory, rebuild zebra, and make some tests Everything should be the same as when only the first 2 patches were applied, EXCEPT this behavior: - create a record with 700$aDoe$bJohn (and nothing in 200$f or $g) - Go in Advanced Search, and select the "Author as phrase" index - with only the first 2 patches, you will have 0 result if you enter "Doe John" or "Doe John" - with the 3 patches, you will have 1 result if you enter "Doe John" or "Doe John" Note that this it betten to test it in advanced search, because the behavior of "au" CCL index in simple search is maybe bugged (it searches the phrase index, while it should probably searches the word index) --- .../unimarc/biblios/biblio-koha-indexdefs.xml | 4 ++ .../unimarc/biblios/biblio-zebra-indexdefs.xsl | 15 +++++++ etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl | 42 ++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml index 53a74ae..752287a 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml @@ -302,6 +302,10 @@ + + Author:p + Personal-name:p + Koha-Auth-Number:w Koha-Auth-Number:n diff --git a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl index 37d29e9..bd3b438 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl +++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl @@ -58,6 +58,21 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + + + + + + + + + + + diff --git a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl index 1488b1c..1803103 100644 --- a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl +++ b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl @@ -14,6 +14,7 @@ + @@ -67,6 +68,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -237,6 +239,46 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + marc:datafield[@tag=' + + '] + + + + + + + + + + + + + + + + + + + contains(' + + ', @code) + + + + + + + + + + + + -- 1.7.9.5