Bugzilla – Attachment 35886 Details for
Bug 7419
Add authority deduplication script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7419: correct LCCN/see from indexing
Bug-7419-correct-LCCNsee-from-indexing.patch (text/plain), 17.15 KB, created by
Julian Maurice
on 2015-02-13 08:43:51 UTC
(
hide
)
Description:
Bug 7419: correct LCCN/see from indexing
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2015-02-13 08:43:51 UTC
Size:
17.15 KB
patch
obsolete
>From 7a549b3b5aee60a71e9813b01c7a2b9e57188bd3 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Tue, 17 Jul 2012 07:46:54 -0400 >Subject: [PATCH] Bug 7419: correct LCCN/see from indexing > >This patch adds indexes for previous headings and LCCN for MARC21 >authority records. See the following patch for a test plan to confirm >that the indexing works correctly. >--- > C4/AuthoritiesMarc.pm | 3 + > etc/searchengine/queryparser.yaml | 11 ++ > .../authorities/authority-koha-indexdefs.xml | 28 +++- > .../authorities/authority-zebra-indexdefs.xsl | 170 ++++++++++++++++++++- > 4 files changed, 207 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 34151fc..96d403b 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -161,6 +161,9 @@ sub SearchAuthorities { > elsif ( @$tags[$i] eq "thesaurus" ) { > $attr = " \@attr 1=Subject-heading-thesaurus "; > } >+ elsif ( @$tags[$i] eq "previous-only" ) { >+ $attr = " \@attr 1=Previous-heading-see-from "; >+ } > else { # Assume any if no index was specified > $attr = " \@attr 1=Any "; > } >diff --git a/etc/searchengine/queryparser.yaml b/etc/searchengine/queryparser.yaml >index d9f637b..935543d 100644 >--- a/etc/searchengine/queryparser.yaml >+++ b/etc/searchengine/queryparser.yaml >@@ -785,6 +785,8 @@ field_mappings: > bib1_mapping: > biblioserver: > 1: 9 >+ authorityserver: >+ 1: LC-card-number > enabled: 1 > index: lc-card-number > aliases: >@@ -961,6 +963,15 @@ field_mappings: > aliases: > - popularity > label: Popularity >+ previous-only: >+ bib1_mapping: >+ authorityserver: >+ 1: Previous-heading-see-from >+ enabled: 1 >+ index: previous-only >+ aliases: >+ - prev-see-from >+ label: Previous-heading-see-from > price: > bib1_mapping: > biblioserver: >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 752cd57..c3b1a78 100644 >--- a/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml >@@ -60,7 +60,6 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Record-source:p</kohaidx:target_index> > </kohaidx:index_subfields> > >- > <!-- Personal name headings --> > <kohaidx:index_subfields tag="100" subfields="abcdefghjklmnopqrstvxyz"> > <kohaidx:target_index>Personal-name:w</kohaidx:target_index> >@@ -101,6 +100,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="400" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="abcdefghjklmnopqrstvxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="500" subfields="abcdefghjklmnopqrstvxyz" subdivisions="vxyz"> > <kohaidx:target_index>Personal-name-see-also-from:w</kohaidx:target_index> >@@ -154,6 +156,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="410" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="abcdefghklmnoprstvxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="510" subfields="abcdefghklmnoprstvxyz" subdivisions="vxyz"> > <kohaidx:target_index>Corporate-name-see-also-from:w</kohaidx:target_index> >@@ -207,6 +212,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="411" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="511" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz"> > <kohaidx:target_index>Meeting-name-see-also-from:w</kohaidx:target_index> >@@ -260,6 +268,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="430" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="adfghklmnoprstvxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="530" subfields="adfghklmnoprstvxyz" subdivisions="vxyz"> > <kohaidx:target_index>Title-uniform-see-also-from:w</kohaidx:target_index> >@@ -313,6 +324,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="448" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="avxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="548" subfields="avxyz" subdivisions="vxyz"> > <kohaidx:target_index>Chronological-term-see-also-from:w</kohaidx:target_index> >@@ -361,15 +375,15 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>See-from:p</kohaidx:target_index> > <kohaidx:target_index>See-from:s</kohaidx:target_index> > </kohaidx:index_heading> >- <kohaidx:index_heading_conditional tag="450" test="substring(marc:subfield[@code='w']/text(), 2, 1)" subfields="abvxyz" subdivisions="vxyz"> >- <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >- </kohaidx:index_heading_conditional> > <kohaidx:index_match_heading tag="450" subfields="abvxyz" subdivisions="vxyz"> > <kohaidx:target_index>Match:w</kohaidx:target_index> > <kohaidx:target_index>Match:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="450" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="abvxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="550" subfields="abvxyz" subdivisions="vxyz"> > <kohaidx:target_index>Subject-topical-see-also-from:w</kohaidx:target_index> >@@ -423,6 +437,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="451" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="avxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="551" subfields="avxyz" subdivisions="vxyz"> > <kohaidx:target_index>Name-geographic-see-also-from:w</kohaidx:target_index> >@@ -476,6 +493,9 @@ authority-zebra-indexdefs.xsl` > <kohaidx:target_index>Match-heading-see-from:p</kohaidx:target_index> > <kohaidx:target_index>Match-heading-see-from:s</kohaidx:target_index> > </kohaidx:index_match_heading> >+ <kohaidx:index_heading_conditional tag="455" test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'" subfields="avxyz" subdivisions="vxyz"> >+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index> >+ </kohaidx:index_heading_conditional> > > <kohaidx:index_heading tag="555" subfields="avxyz" subdivisions="vxyz"> > <kohaidx:target_index>Term-genre-form-see-also-from:w</kohaidx:target_index> >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 58eceed..2596749 100644 >--- a/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl >@@ -1123,8 +1123,128 @@ 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='400']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> >+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='410']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> >+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='411']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> >+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='430']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> >+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='448']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> > <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']"> >- <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> > <z:index name="Previous-heading-see-from:p"> > <xslo:variable name="raw_heading"> > <xslo:for-each select="marc:subfield"> >@@ -1147,6 +1267,54 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </z:index> > </xslo:if> > </xslo:template> >+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='451']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> >+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='455']"> >+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 3, 1)='e'"> >+ <z:index name="Previous-heading-see-from:p"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('avxyz', @code)" name="Previous-heading-see-from:p"> >+ <xslo:if test="position() > 1"> >+ <xslo:choose> >+ <xslo:when test="contains('vxyz', @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:if> >+ </xslo:template> > <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']"> > <z:index name="Match:w Match:p Match-heading:p Match-heading:s"> > <xslo:variable name="raw_heading"> >-- >1.9.1
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 7419
:
11161
|
11162
|
11412
|
11413
|
11486
|
11487
|
11488
|
13073
|
13074
|
13629
|
13630
|
17790
|
17791
|
17792
|
18712
|
18713
|
18714
|
20783
|
20784
|
20785
|
22150
|
22907
|
25087
|
25088
|
25089
| 35886 |
35887
|
35888
|
35889
|
42972