Bugzilla – Attachment 12877 Details for
Bug 8665
DOM indexing fails to index some bib records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8665: DOM indexing fails to index some bib records
Bug-8665-DOM-indexing-fails-to-index-some-bib-reco.patch (text/plain), 9.83 KB, created by
Chris Cormack
on 2012-10-17 07:09:22 UTC
(
hide
)
Description:
Bug 8665: DOM indexing fails to index some bib records
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2012-10-17 07:09:22 UTC
Size:
9.83 KB
patch
obsolete
>From f2123ceb6735d128e85dc7679368cc80ede66a2e Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Thu, 4 Oct 2012 08:52:48 -0400 >Subject: [PATCH] Bug 8665: DOM indexing fails to index some bib records > >Use a user-specified field for z:id. > >This patch also fixes an excess space before the index in the MARC21 >biblio index definitions, which someone fixed in the generated file >but not in the source file it should have been fixed in. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > .../marc_defs/marc21/authorities/authority-koha-indexdefs.xml | 1 + > .../marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl | 6 +++--- > etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml | 3 ++- > etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl | 6 ++++-- > etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml | 1 + > etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl | 6 ++++-- > etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl | 6 ++++-- > 7 files changed, 19 insertions(+), 10 deletions(-) > >diff --git a/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml b/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml >index 4599728..5a34eb2 100644 >--- a/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml >@@ -6,6 +6,7 @@ run the following command: > authority-zebra-indexdefs.xsl` > --> > <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs"> >+ <id>marc:controlfield[@tag='001']</id> > <!-- variables --> > <kohaidx:var name="form_subdivision_subfield">v</kohaidx:var> > <kohaidx:var name="general_subdivision_subfield">x</kohaidx:var> >diff --git a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >index 1bafa16..5c80c2c 100644 >--- a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >@@ -27,10 +27,10 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:template> > <xslo:template match="marc:record"> >- <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/> >+ <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/> > <z:record type="update"> > <xslo:attribute name="z:id"> >- <xslo:value-of select="$controlField001"/> >+ <xslo:value-of select="$idfield"/> > </xslo:attribute> > <xslo:apply-templates/> > <xslo:apply-templates mode="index_subfields"/> >@@ -1122,7 +1122,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:value-of select="normalize-space($raw_heading)"/> > </z:index> > </xslo:template> >- <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']"> >+ <xslo:template mode="index_heading_conditional"> > <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)"> > <z:index name="Previous-heading-see-from:p"> > <xslo:variable name="raw_heading"> >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 9219000..14443d6 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -1,6 +1,7 @@ > <?xml version="1.0" encoding="utf-8"?> > <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs"> > <!--record.abs line 40: xelm /record/leader llength:w:range(data,0,5),rtype:w:range(data,6,1),Bib-level:w:range(data,7,1)--> >+ <id>marc:datafield[@tag='999']/marc:subfield[@code='c']</id> > <index_leader xmlns="http://www.koha-community.org/schemas/index-defs" offset="0" length="5"> > <target_index>llength:w</target_index> > </index_leader> >@@ -1124,7 +1125,7 @@ > </index_subfields> > <!--record.abs line 286: melm 952$3 materials-specified --> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="3"> >- <target_index>materials-specified :w</target_index> >+ <target_index>materials-specified:w</target_index> > </index_subfields> > <!--record.abs line 287: melm 952$4 damaged:n,damaged:w--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="4"> >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 06b7882..14f299e 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -13,6 +13,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:template match="text()" mode="index_subfields"/> > <xslo:template match="text()" mode="index_data_field"/> > <xslo:template match="text()" mode="index_heading"/> >+ <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="/"> >@@ -26,15 +27,16 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:template> > <xslo:template match="marc:record"> >- <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/> >+ <xslo:variable name="idfield" select="normalize-space(marc:datafield[@tag='999']/marc:subfield[@code='c'])"/> > <z:record type="update"> > <xslo:attribute name="z:id"> >- <xslo:value-of select="$controlField001"/> >+ <xslo:value-of select="$idfield"/> > </xslo:attribute> > <xslo:apply-templates/> > <xslo:apply-templates mode="index_subfields"/> > <xslo:apply-templates mode="index_data_field"/> > <xslo:apply-templates mode="index_heading"/> >+ <xslo:apply-templates mode="index_heading_conditional"/> > <xslo:apply-templates mode="index_match_heading"/> > <xslo:apply-templates mode="index_subject_thesaurus"/> > </z:record> >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 6870469..8eecf1c 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -1,5 +1,6 @@ > <?xml version="1.0" encoding="utf-8"?> > <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs"> >+ <id>marc:controlfield[@tag='001']</id> > <!--record.abs line 24: melm 001 Local-number,Local-number:n--> > <index_control_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="001"> > <target_index>Local-number:w</target_index> >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 feeda35..46e190f 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >@@ -13,6 +13,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:template match="text()" mode="index_subfields"/> > <xslo:template match="text()" mode="index_data_field"/> > <xslo:template match="text()" mode="index_heading"/> >+ <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="/"> >@@ -26,15 +27,16 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:template> > <xslo:template match="marc:record"> >- <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/> >+ <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/> > <z:record type="update"> > <xslo:attribute name="z:id"> >- <xslo:value-of select="$controlField001"/> >+ <xslo:value-of select="$idfield"/> > </xslo:attribute> > <xslo:apply-templates/> > <xslo:apply-templates mode="index_subfields"/> > <xslo:apply-templates mode="index_data_field"/> > <xslo:apply-templates mode="index_heading"/> >+ <xslo:apply-templates mode="index_heading_conditional"/> > <xslo:apply-templates mode="index_match_heading"/> > <xslo:apply-templates mode="index_subject_thesaurus"/> > </z:record> >diff --git a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl >index 2316d3f..47c47a7 100644 >--- a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl >+++ b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl >@@ -49,9 +49,11 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:template> > > <xslo:template match="marc:record"> >- <xslo:variable name="controlField001" select="normalize-space(marc:controlfield[@tag='001'])"/> >+ <xslo:variable name="idfield"> >+ <xsl:attribute name="select">normalize-space(<xsl:value-of select="//id"/>)</xsl:attribute> >+ </xslo:variable> > <z:record type="update"> >- <xslo:attribute name="z:id"><xslo:value-of select="$controlField001"/></xslo:attribute> >+ <xslo:attribute name="z:id"><xslo:value-of select="$idfield"/></xslo:attribute> > <xslo:apply-templates/> > <xslo:apply-templates mode="index_subfields"/> > <xslo:apply-templates mode="index_data_field"/> >-- >1.7.10.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 8665
:
12684
|
12734
|
12877
|
13058
|
13085
|
13086