From 9083be54185c260822c2a5f923fff8655ef689bd Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Wed, 18 Mar 2015 13:11:03 +0200 Subject: [PATCH] [PASSED QA] 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=''" where is the stuff you wrote in the MARC-field. 4. Observe the found record. Signed-off-by: Bernardo Gonzalez Kriegel Tested on MARC21 and UNIMARC, works No errors Signed-off-by: Kyle M Hall --- 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 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 1389e5b..48916f9 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 @@ Title-other-variant:w Related-periodical:w + + + Edition:w + Edition:p + Edition:s + pl:w 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) + + + + + + + + + + + + + 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 @@ Title-expanded:w Title-former:w + + + Edition:w + Edition:p + Edition:s + pl:w 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) + + + + + + + + + + + + + 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 @@ Title:w Title:p + Edition:w + Edition:p + Edition:s 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) - + -- 1.7.2.5