Bugzilla – Attachment 41376 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]
Bug 11194: Add a new index for "Edition Statement" of a MARC Record
Bug-11194-Add-a-new-index-for-Edition-Statement-of.patch (text/plain), 9.40 KB, created by
Jonathan Druart
on 2015-08-05 10:42:03 UTC
(
hide
)
Description:
Bug 11194: Add a new index for "Edition Statement" of a MARC Record
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-05 10:42:03 UTC
Size:
9.40 KB
patch
obsolete
>From 841d3dd3f449aa79f92b96f9809d907b48276ce3 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] 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 > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Search.pm | 1 + > Koha/QueryParser/Driver/PQF.pm | 1 + > etc/zebradb/ccl.properties | 3 +++ > .../marc_defs/marc21/biblios/biblio-koha-indexdefs.xml | 6 ++++++ > .../marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl | 13 +++++++++++++ > .../marc_defs/normarc/biblios/biblio-koha-indexdefs.xml | 6 ++++++ > .../marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl | 13 +++++++++++++ > .../marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../marc_defs/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 4f2a7c7..f437fdc 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1136,6 +1136,7 @@ sub getIndexes{ > 'diss', > '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 4b3241c..da7beb6 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -366,6 +366,9 @@ diss Dissertation-information > 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 101f6ff..68dd201 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 3dd627f..a9403ea 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 0fc90e5..52fa812 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"> >-- >2.1.0
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