From b89eee35c9e9a5083e862d9e45e6d5e5d890cbf6 Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Mon, 1 Sep 2014 23:33:49 +0200 Subject: [PATCH 3/3] Bug 9352: 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 Author:p This patch also change the biblio-koha-indexdefs.xml and biblio-zebra-indexdefs.xsl for UNIMARC, in order to use this new template for 700-712 fields For 700 and 710, it also indexes in "Author:s" (used for sorting) the concatenation of subfields instead of only the $a subfield 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" - same kind of test for 710 field - the logic is the same for 701, 702,711, 712. So, no need to test - make some searches and test the sorting of your results by author name ("Author A-Z" and "Author Z-A"). The complete name of main author (700 and 710) sould be used for sorting the results, instead of only $& Note that this it better 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 | 60 +++----- .../unimarc/biblios/biblio-zebra-indexdefs.xsl | 148 ++++++++++++-------- etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl | 46 ++++++ 3 files changed, 156 insertions(+), 98 deletions(-) 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 cf27720..55e5cdd 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml @@ -302,24 +302,16 @@ - - Koha-Auth-Number:w - Koha-Auth-Number:n - - - Author:w - Personal-name:w + Author:p - Personal-name:p - Personal-name:w - Author:s - - Author:w - Personal-name:w - Author:p Personal-name:p Personal-name:w + Author:s + + + Koha-Auth-Number:w + Koha-Auth-Number:n @@ -327,33 +319,29 @@ Koha-Auth-Number:w Koha-Auth-Number:n - - Author:w - Personal-name:w + Author:p + Author:w Personal-name:p Personal-name:w - - + Koha-Auth-Number:w Koha-Auth-Number:n - - Author:w - Personal-name:w + Author:p + Author:w Personal-name:p Personal-name:w - - + Koha-Auth-Number:w Koha-Auth-Number:n - + Author:w Author-name-corporate:w Author-name-conference:w @@ -365,26 +353,14 @@ Corporate-name:p Conference-name:p Author:s - - - Author:w - Author-name-corporate:w - Author-name-conference:w - Corporate-name:w - Conference-name:w - Author:p - Author-name-corporate:p - Author-name-conference:p - Corporate-name:p - Conference-name:p - + Koha-Auth-Number:w Koha-Auth-Number:n - + Author:w Author-name-corporate:w Author-name-conference:w @@ -395,14 +371,14 @@ Author-name-conference:p Corporate-name:p Conference-name:p - + Koha-Auth-Number:w Koha-Auth-Number:n - + Author:w Author-name-corporate:w Author-name-conference:w @@ -413,7 +389,7 @@ Author-name-conference:p Corporate-name:p Conference-name:p - + 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 c66b377..ad4332a 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl +++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl @@ -10,6 +10,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -33,6 +34,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -58,6 +60,96 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -669,20 +761,6 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - - - - - - - - @@ -692,13 +770,6 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - @@ -708,13 +779,6 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - @@ -724,20 +788,6 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - - - - - - - - @@ -747,13 +797,6 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - @@ -763,13 +806,6 @@ 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..ad2a61f 100644 --- a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl +++ b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl @@ -14,6 +14,7 @@ + @@ -31,6 +32,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -55,6 +57,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -67,6 +70,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + @@ -237,6 +241,48 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) + + + + + marc:datafield[@tag=' + + '] + + + + + + + + + + + + + + + + + + + + contains(' + + ', @code) + + + + + + + + + + + + + -- 1.7.9.5