Bugzilla – Attachment 59675 Details for
Bug 18017
Use index_heading and index_match_heading in UNIMARC authorities zebra configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18017 - add index_matching_heading to create indexes for matching an entire authority heading
Bug-18017---add-indexmatchingheading-to-create-ind.patch (text/plain), 7.47 KB, created by
Alex Arnaud
on 2017-01-31 09:38:52 UTC
(
hide
)
Description:
Bug 18017 - add index_matching_heading to create indexes for matching an entire authority heading
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2017-01-31 09:38:52 UTC
Size:
7.47 KB
patch
obsolete
>From e48d2c55ebff8df715015cf82524512d39ad64c1 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Tue, 31 Jan 2017 09:37:25 +0000 >Subject: [PATCH] Bug 18017 - add index_matching_heading to create indexes for > matching an entire authority heading > >--- > .../authorities/authority-koha-indexdefs.xml | 10 ++- > .../authorities/authority-zebra-indexdefs.xsl | 78 +++++++++++++++++++++- > 2 files changed, 86 insertions(+), 2 deletions(-) > >diff --git a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml b/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml >index 2695c94..60c48a0 100644 >--- a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml >@@ -18,13 +18,21 @@ authority-zebra-indexdefs.xsl` > <kohaidx:index_subfields tag="200" subfields="abcdfgjxyz"> > <kohaidx:target_index>Personal-name:w</kohaidx:target_index> > <kohaidx:target_index>Personal-name:p</kohaidx:target_index> >+ <kohaidx:target_index>Personal-name:s</kohaidx:target_index> >+ </kohaidx:index_subfields> >+ <kohaidx:index_heading tag="200" subfields="abcdfgjxyz"> > <kohaidx:target_index>Heading:w</kohaidx:target_index> > <kohaidx:target_index>Heading:p</kohaidx:target_index> >+ <kohaidx:target_index>Heading:s</kohaidx:target_index> >+ </kohaidx:index_heading> >+ <kohaidx:index_match_heading tag="200" subfields="abcdfgjxyz"> > <kohaidx:target_index>Match:w</kohaidx:target_index> > <kohaidx:target_index>Match:p</kohaidx:target_index> >+ <kohaidx:target_index>Match:s</kohaidx:target_index> > <kohaidx:target_index>Match-heading:w</kohaidx:target_index> > <kohaidx:target_index>Match-heading:p</kohaidx:target_index> >- </kohaidx:index_subfields> >+ <kohaidx:target_index>Match-heading:s</kohaidx:target_index> >+ </kohaidx:index_match_heading> > <kohaidx:index_subfields tag="200" subfields="a"> > <kohaidx:target_index>Heading:s</kohaidx:target_index> > <kohaidx:target_index>Heading-Main:w</kohaidx:target_index> >diff --git a/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl >index df20a49..c9ec1da 100644 >--- a/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl >@@ -17,6 +17,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:template match="text()" mode="index_heading_conditional"/> > <xslo:template match="text()" mode="index_match_heading"/> > <xslo:template match="text()" mode="index_subject_thesaurus"/> >+ <xslo:template match="text()" mode="index_sort_tit"/> > <xslo:template match="/"> > <xslo:if test="marc:collection"> > <collection> >@@ -42,6 +43,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:apply-templates mode="index_match_heading"/> > <xslo:apply-templates mode="index_subject_thesaurus"/> > <xslo:apply-templates mode="index_all"/> >+ <xslo:apply-templates mode="index_sort_tit"/> > </z:record> > </xslo:template> > <xslo:template match="marc:controlfield[@tag='001']"> >@@ -52,7 +54,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:template mode="index_subfields" match="marc:datafield[@tag='200']"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('abcdfgjxyz', @code)"> >- <z:index name="Personal-name:w Personal-name:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p"> >+ <z:index name="Personal-name:w Personal-name:p Personal-name:s"> > <xslo:value-of select="."/> > </z:index> > </xslo:if> >@@ -646,11 +648,85 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > </xslo:template> >+ <xslo:template mode="index_heading" match="marc:datafield[@tag='200']"> >+ <z:index name="Heading:w Heading:p Heading:s"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('abcdfgjxyz', @code)" name="Heading:w Heading:p Heading:s"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('', @code)"> >+ <xslo:text>--</xslo:text> >+ </xslo:when> >+ <xslo:otherwise> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:otherwise> >+ </xslo:choose> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ </xslo:template> >+ <xslo:template mode="index_match_heading" match="marc:datafield[@tag='200']"> >+ <z:index name="Match:w Match:p Match:s Match-heading:w Match-heading:p Match-heading:s"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('abcdfgjxyz', @code)" name="Match:w Match:p Match:s Match-heading:w Match-heading:p Match-heading:s"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('', @code)"> >+ <xslo:choose> >+ <xslo:when test="@code = $general_subdivision_subfield"> >+ <xslo:text> generalsubdiv </xslo:text> >+ </xslo:when> >+ <xslo:when test="@code = $form_subdivision_subfield"> >+ <xslo:text> formsubdiv </xslo:text> >+ </xslo:when> >+ <xslo:when test="@code = $chronological_subdivision_subfield"> >+ <xslo:text> chronologicalsubdiv </xslo:text> >+ </xslo:when> >+ <xslo:when test="@code = $geographic_subdivision_subfield"> >+ <xslo:text> geographicsubdiv </xslo:text> >+ </xslo:when> >+ </xslo:choose> >+ </xslo:when> >+ <xslo:otherwise> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:otherwise> >+ </xslo:choose> >+ </xslo:if> >+ <xslo:call-template name="chopPunctuation"> >+ <xslo:with-param name="chopString"> >+ <xslo:value-of select="."/> >+ </xslo:with-param> >+ </xslo:call-template> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ </xslo:template> > <xslo:template mode="index_all" match="text()"> > <z:index name="Any:w Any:p"> > <xslo:value-of select="."/> > </z:index> > </xslo:template> >+ <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']"> >+ <xslo:variable name="chop"> >+ <xslo:choose> >+ <xslo:when test="not(number(@ind2))">0</xslo:when> >+ <xslo:otherwise> >+ <xslo:value-of select="number(@ind2)"/> >+ </xslo:otherwise> >+ </xslo:choose> >+ </xslo:variable> >+ <z:index name="Title:s"> >+ <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/> >+ </z:index> >+ </xslo:template> > <xslo:template name="chopPunctuation"> > <xslo:param name="chopString"/> > <xslo:variable name="length" select="string-length($chopString)"/> >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18017
:
59675
|
114588
|
114589
|
114590
|
117182
|
117183
|
117350
|
117351