Bugzilla – Attachment 57946 Details for
Bug 17547
(MARC21) Chronological term link subfield 648$9 not indexed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17547: (MARC21|NORMARC) have Chronological term field $9 indexed
Bug-17547-MARC21NORMARC-have-Chronological-term-fi.patch (text/plain), 6.87 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-12-02 20:52:14 UTC
(
hide
)
Description:
Bug 17547: (MARC21|NORMARC) have Chronological term field $9 indexed
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-12-02 20:52:14 UTC
Size:
6.87 KB
patch
obsolete
>From 1afa9003bf08491a429255eeb638ced5d6980a10 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 2 Dec 2016 17:16:10 -0300 >Subject: [PATCH] Bug 17547: (MARC21|NORMARC) have Chronological term field $9 > indexed > >This patch makes Zebra index the 648$9 link for chronological terms on >bibliographic records. This way an authority search on chronological terms >will show the right number in 'Used in X records' message. > >To test: >- Have a record with a 648 field, linked to an authority record (i.e. with an authid on 648$9). >- Search for the record, notice it is indexed. >- Perform an authority search for the chronological term >=> FAIL: the term is linked to our record, but koha shows '0' count. >- Apply the patch >- Run: > $ cd kohaclone > $ xsltproc etc/zebra/xsl/koha-indexdefs-to-zebra.xsl \ > etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \ > > etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl > $ git diff >=> SUCCESS: Notice the shipped etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl > is up-to-date >- Run: > $ sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \ > /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl > $ sudo koha-restart-zebra kohadev > $ sudo koha-rebuild-zebra -f -b -v kohadev >- Search for the record, notice it is indexed. >- Perform an authority search for the chronological term >=> SUCCESS: the term is linked to our record, usage count is 1 >- Sign off :-D > >I assume NORMARC is similar on this regard. Feel free to fail it if the NORMARC part of the >patch is wrong. > >Sponsored-by: Universidad Nacional de Cordoba >--- > .../marc21/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 9 ++++++++ > .../normarc/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../normarc/biblios/biblio-zebra-indexdefs.xsl | 24 ++++++++++++++++++++++ > 4 files changed, 39 insertions(+) > >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >index 38f91a2..49f774a 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -709,6 +709,9 @@ > <target_index>Subject:w</target_index> > <target_index>Subject:p</target_index> > </index_data_field> >+ <index_subfields tag="648" subfields="9"> >+ <target_index>Koha-Auth-Number:w</target_index> >+ </index_subfields> > <!--record.abs line 177: melm 650$9 Koha-Auth-Number --> > <index_subfields tag="650" subfields="9"> > <target_index>Koha-Auth-Number:w</target_index> >diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >index dd2a760..5feab04 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -628,6 +628,15 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > </xslo:template> >+ <xslo:template mode="index_subfields" match="marc:datafield[@tag='648']"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('9', @code)"> >+ <z:index name="Koha-Auth-Number:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:template> > <xslo:template mode="index_subfields" match="marc:datafield[@tag='650']"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('9', @code)"> >diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >index 0918f2a..dff2d75 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >@@ -477,6 +477,9 @@ > <target_index>Subject:w</target_index> > <target_index>Subject:p</target_index> > </index_data_field> >+ <index_subfields tag="648" subfields="9"> >+ <target_index>Koha-Auth-Number:w</target_index> >+ </index_subfields> > <!--record.abs line 199: melm 650$9 Koha-Auth-Number--> > <index_subfields tag="650" subfields="9"> > <target_index>Koha-Auth-Number:w</target_index> >diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >index 1eeca69..301f9a7 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-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:leader"> >@@ -409,6 +411,15 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > </xslo:template> >+ <xslo:template mode="index_subfields" match="marc:datafield[@tag='648']"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('9', @code)"> >+ <z:index name="Koha-Auth-Number:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:template> > <xslo:template mode="index_subfields" match="marc:datafield[@tag='650']"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('9', @code)"> >@@ -1855,6 +1866,19 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <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 17547
:
57946
|
58168