Bugzilla – Attachment 40321 Details for
Bug 11194
Add a new index for "Edition Statement" of a MARC Record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 11194: Add a new index for "Edition Statement" of a MARC Record
SIGNED-OFF-Bug-11194-Add-a-new-index-for-Edition-S.patch (text/plain), 9.30 KB, created by
Bernardo Gonzalez Kriegel
on 2015-06-18 16:27:22 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11194: Add a new index for "Edition Statement" of a MARC Record
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-06-18 16:27:22 UTC
Size:
9.30 KB
patch
obsolete
>From 5a5f0119e51710882dca548a9ed42737c6dce7a9 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Wed, 18 Mar 2015 13:11:03 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 11194: Add a new index for "Edition > Statement" of a MARC Record > >Adds the "Edition Statement" MARC-field as a sortable search index in Koha. >This Field is also used by the MARC::Record->edition(). > >It is mapped to search keyword "edition" and it targets the following MARC-fields: > >UNIMARC: all 205-subfields concatenated >MARC21 : all 250-subfields concatenated >NORMARC: all 250-subfields concatenated > >After applying this patch a full biblio reindexing needs to be done to make old >records searchable. New Biblios, and Biblios that are part of some operations >(checkin/out/hold/...), are searchable. These generate good test data to test >this feature without fully reindexing the search index. > >TEST PLAN: >0. Move the search index and search word definitions from the koha source code > to the directory where Zebra uses them. > This is most easiest to do by reinstalling Koha, but can be manually moved > as well. >1. Find a record with some data in the "Edition Statement" -field. >2. Modify that Record and reindex it. >3. Search with the keyword "edition='<edition_statement>'" where > <edition_statement> is the stuff you wrote in the MARC-field. >4. Observe the found record. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Tested on MARC21 and UNIMARC, works >No errors >--- > C4/Search.pm | 1 + > Koha/QueryParser/Driver/PQF.pm | 1 + > etc/zebradb/ccl.properties | 3 +++ > .../marc21/biblios/biblio-koha-indexdefs.xml | 6 ++++++ > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 13 +++++++++++++ > .../normarc/biblios/biblio-koha-indexdefs.xml | 6 ++++++ > .../normarc/biblios/biblio-zebra-indexdefs.xsl | 13 +++++++++++++ > .../unimarc/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../unimarc/biblios/biblio-zebra-indexdefs.xsl | 2 +- > 9 files changed, 47 insertions(+), 1 deletion(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 990ed39..da61bf9 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1135,6 +1135,7 @@ sub getIndexes{ > 'Dissertation-information', > 'EAN', > 'extent', >+ 'Edition', > 'fic', > 'fiction', > 'Form-subdivision', >diff --git a/Koha/QueryParser/Driver/PQF.pm b/Koha/QueryParser/Driver/PQF.pm >index 8181cd3..4ea5277 100644 >--- a/Koha/QueryParser/Driver/PQF.pm >+++ b/Koha/QueryParser/Driver/PQF.pm >@@ -679,6 +679,7 @@ sub TEST_SETUP { > $self->add_bib1_field_map('author' => 'personal' => 'biblioserver' => { '1' => '1004' } ); > $self->add_bib1_field_map('author' => 'corporate' => 'biblioserver' => { '1' => '1005' } ); > $self->add_search_field_alias( 'author' => 'corporate' => 'cpn' ); >+ $self->add_bib1_field_map('keyword' => 'Edition' => 'biblioserver' => { '1' => '9016' } ); > $self->add_bib1_field_map('author' => 'conference' => 'biblioserver' => { '1' => '1006' } ); > $self->add_search_field_alias( 'author' => 'conference' => 'cfn' ); > $self->add_bib1_field_map('keyword' => 'local-classification' => 'biblioserver' => { '1' => '20' } ); >diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties >index 99e3498..c6d3a4d 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -365,6 +365,9 @@ Dissertation-information 1=1056 > EAN 1=1214 > ean EAN > >+#Edition Statement >+Edition 1=1223 >+ > #Identifier-- 1013 Used in full-text searching > #authority/format to indicate to the target > # system the format of the >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 8ad9db1..2ceead0 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -412,6 +412,12 @@ > <target_index>Title-other-variant:w</target_index> > <target_index>Related-periodical:w</target_index> > </index_data_field> >+ <!--record.abs line 118: melm 250 Edition--> >+ <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="250"> >+ <target_index>Edition:w</target_index> >+ <target_index>Edition:p</target_index> >+ <target_index>Edition:s</target_index> >+ </index_data_field> > <!--record.abs line 119: melm 260$a pl:w,pl:p--> > <index_subfields tag="260" subfields="a"> > <target_index>pl: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 a0f68f1..151f38d 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -1839,6 +1839,19 @@ 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_data_field" match="marc:datafield[@tag='250']"> >+ <z:index name="Edition:w Edition:p Edition:s"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='260']"> > <z:index name="pl:w"> > <xslo:variable name="raw_heading"> >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..628c805 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >@@ -296,6 +296,12 @@ > <target_index>Title-expanded:w</target_index> > <target_index>Title-former:w</target_index> > </index_data_field> >+ <!--record.abs line 118: melm 250 Edition--> >+ <index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="250"> >+ <target_index>Edition:w</target_index> >+ <target_index>Edition:p</target_index> >+ <target_index>Edition:s</target_index> >+ </index_data_field> > <!--record.abs line 144: melm 260$a pl:w,pl:p--> > <index_subfields tag="260" subfields="a"> > <target_index>pl: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..f3f5625 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >@@ -1346,6 +1346,19 @@ 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_data_field" match="marc:datafield[@tag='250']"> >+ <z:index name="Edition:w Edition:p Edition:s"> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='260']"> > <z:index name="pl:w"> > <xslo:variable name="raw_heading"> >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 85cc089..a916948 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -491,6 +491,9 @@ > <index_data_field tag="205"> > <target_index>Title:w</target_index> > <target_index>Title:p</target_index> >+ <target_index>Edition:w</target_index> >+ <target_index>Edition:p</target_index> >+ <target_index>Edition:s</target_index> > </index_data_field> > <!--206 - Material Specific Area fields : maps--> > <!--207 - Material Specific Area fields : serials--> >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 c78e459..e464d6f 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >@@ -2022,7 +2022,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </z:index> > </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='205']"> >- <z:index name="Title:w Title:p"> >+ <z:index name="Title:w Title:p Edition:w Edition:p Edition:s"> > <xslo:variable name="raw_heading"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="position() > 1"> >-- >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 11194
:
36978
|
36979
|
40321
|
40939
|
41376