From 841d3dd3f449aa79f92b96f9809d907b48276ce3 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti 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=''" 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: Jonathan Druart --- 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 @@ 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 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) + + + + + + + + + + + + + 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) - + -- 2.1.0