Bugzilla – Attachment 17771 Details for
Bug 9940
Add a new index for original language of document
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Bug 9940 : Add a new index for the original language of a document
0001-patch.patch (text/plain), 8.60 KB, created by
Mathieu Saby
on 2013-04-28 13:27:46 UTC
(
hide
)
Description:
[PATCH] Bug 9940 : Add a new index for the original language of a document
Filename:
MIME Type:
Creator:
Mathieu Saby
Created:
2013-04-28 13:27:46 UTC
Size:
8.60 KB
patch
obsolete
>From 0bd591a9f7b002be56dded04c20629eb103f3a96 Mon Sep 17 00:00:00 2001 >From: Mathieu Saby <mathieu.saby@univ-rennes2.fr> >Date: Sun, 28 Apr 2013 14:44:21 +0200 >Subject: [PATCH] Bug 9940 : Add a new index for the original language of a document > >It could be useful to index the original language of a document (i.e. "fre" for the english translation of a french novel). >This patch rename 1095 bib1 attribute (Code-language-original => language-original) and use it to index : >- MARC21 041$h subfield >- UNIMARC 101$c subfield >It adds "language-original" in the list of index in Search.pm. > >Test plan : >A. in a MARC21 GRS1 environment >1. Copy Zebra config files (zebradb/biblios/etc/bib1.att, zebradb/ccl.properties, marc_defs/marc21/biblios/record.abs) from your source etc/ directory to your main koha etc/ directory >2. Reindex zebra >3. Make some searches, like "language-original:fre" >B. in a MARC21 DOM environment >4. Copy Zebra config files (zebradb/biblios/etc/bib1.att, zebradb/ccl.properties, marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl) from your source etc/ directory to your main koha etc/ directory >5. Reindex zebra >6. Make some searches, like "language-original:fre" >C. in a UNIMARC GRS1 environment >7. Copy Zebra config files (zebradb/biblios/etc/bib1.att, zebradb/ccl.properties, marc_defs/unimarc/biblios/record.abs) from your source etc/ directory to your main koha etc/ directory >8. Reindex zebra >9. Make some searches, like "language-original:fre" >A. in a UNIMARC DOM environment >10. Copy Zebra config files (zebradb/biblios/etc/bib1.att, zebradb/ccl.properties, marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl) from your source etc/ directory to your main koha etc/ directory >11. Reindex zebra >12. Make some searches, like "language-original:fre" >--- > C4/Search.pm | 1 + > etc/zebradb/biblios/etc/bib1.att | 2 +- > etc/zebradb/ccl.properties | 5 +++++ > .../marc21/biblios/biblio-koha-indexdefs.xml | 4 ++++ > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 7 +++++++ > etc/zebradb/marc_defs/marc21/biblios/record.abs | 1 + > .../unimarc/biblios/biblio-koha-indexdefs.xml | 4 ++++ > .../unimarc/biblios/biblio-zebra-indexdefs.xsl | 9 +++++++++ > etc/zebradb/marc_defs/unimarc/biblios/record.abs | 1 + > 9 files changed, 33 insertions(+), 1 deletion(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 8261e0a..3e80008 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -984,6 +984,7 @@ sub getIndexes{ > 'Koha-Auth-Number', > 'l-format', > 'language', >+ 'language-original', > 'lc-card', > 'LC-card-number', > 'lcn', >diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att >index b2c38c4..49306fd 100644 >--- a/etc/zebradb/biblios/etc/bib1.att >+++ b/etc/zebradb/biblios/etc/bib1.att >@@ -162,7 +162,7 @@ att 1091 Identifier-ISRC > att 1092 Identifier-ISMN > att 1093 Identifier-ISRN > att 1094 Identifier-DOI >-att 1095 Code-language-original >+att 1095 language-original > att 1096 Title-later > > att 1185 Performer >diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties >index a5de010..0a9bd17 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -254,6 +254,11 @@ Code-institution 1=56 > language 1=54 > ln language > >+# >+#Code-language-original 1095 A code that indicates the MARC21 041$h >+# original language of the item. UNIMARC 101$c >+language-original 1=1095 >+ > #Code-map-scale 1024 Coded form of cartographic 034 > # mathematical data, including > # scale, projection and/or >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 14443d6..8ba1228 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -186,6 +186,10 @@ > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="041" subfields="e"> > <target_index>ln:w</target_index> > </index_subfields> >+ <!--record.abs melm 041$h language-original--> >+ <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="041" subfields="h"> >+ <target_index>language-original:w</target_index> >+ </index_subfields> > <!--record.abs line 73: melm 041$j ln--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="041" subfields="j"> > <target_index>ln: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 26858e8..fc17f17 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -180,6 +180,13 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('h', @code)"> >+ <z:index name="language-original:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('j', @code)"> > <z:index name="ln:w"> > <xslo:value-of select="."/> >diff --git a/etc/zebradb/marc_defs/marc21/biblios/record.abs b/etc/zebradb/marc_defs/marc21/biblios/record.abs >index 5ff08f4..7b6a2ca 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/record.abs >+++ b/etc/zebradb/marc_defs/marc21/biblios/record.abs >@@ -78,6 +78,7 @@ melm 040 Code-institution,Record-source > melm 041$a ln > melm 041$d ln > melm 041$e ln >+melm 041$h language-original > melm 041$j ln > melm 043 Code-geographic > #melm 046 pubdate >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 ceaba51..1c99c3b 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -189,6 +189,10 @@ > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="101" subfields="a"> > <target_index>ln:w</target_index> > </index_subfields> >+ <!--record.abs line 49: melm 101$h language-original--> >+ <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="101" subfields="c"> >+ <target_index>language-original:w</target_index> >+ </index_subfields> > <!--record.abs line 50: melm 102$a Country-heading--> > <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="102" subfields="a"> > <target_index>Country-heading: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 f1e82e3..131b82d 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >@@ -471,6 +471,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='101']"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('c', @code)"> >+ <z:index name="language-original:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ </xslo:template> > <xslo:template mode="index_subfields" match="marc:datafield[@tag='102']"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('a', @code)"> >diff --git a/etc/zebradb/marc_defs/unimarc/biblios/record.abs b/etc/zebradb/marc_defs/unimarc/biblios/record.abs >index dd481b6..b4bf06a 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/record.abs >+++ b/etc/zebradb/marc_defs/unimarc/biblios/record.abs >@@ -89,6 +89,7 @@ melm 995$r itemtype:w,itemtype:p,itype:w,itype:p > ############ CODED INFORMATIONS ################## > melm 100$a tpubdate:s:range(data,8,1),ta:w:range(data,17,1),ta:w:range(data,18,1),ta:w:range(data,19,1),Modified-code:n:range(data,21,1),ln:s:range(data,22,3),char-encoding:n:range(data,26,2),char-encoding:n:range(data,28,2),char-encoding:n:range(data,30,2),script-Title:n:range(data,34,2) > melm 101$a ln >+melm 101$c language-original > melm 102$a Country-heading > > #Field 105 Description >-- >1.7.9.5 >
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 9940
:
17771
|
22382
|
23794
|
23804
|
23805