Bugzilla – Attachment 123697 Details for
Bug 28830
Add CNI (Control Number Identifier) search index (MARC21)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28830: Add cni index for 003
Bug-28830-Add-cni-index-for-003.patch (text/plain), 4.98 KB, created by
Martin Renvoize (ashimema)
on 2021-08-10 14:13:32 UTC
(
hide
)
Description:
Bug 28830: Add cni index for 003
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-08-10 14:13:32 UTC
Size:
4.98 KB
patch
obsolete
>From dcb82c18ce0c02d0b80a96ec0948e09498934fdb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 9 Aug 2021 12:06:30 +0100 >Subject: [PATCH] Bug 28830: Add cni index for 003 > >This patch adds the cni/Control-number-identifier index to enable >searches to use the 003 field. > >Test plan >1/ Apply patch >2/ Re-index using updated configurations >3/ Confirm cni:number searches yield the expected results >4/ Signoff > >Split-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Search.pm | 2 ++ > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + > admin/searchengine/elasticsearch/mappings.yaml | 9 +++++++++ > etc/zebradb/biblios/etc/bib1.att | 1 + > etc/zebradb/ccl.properties | 3 +++ > .../marc_defs/marc21/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl | 5 +++++ > 7 files changed, 24 insertions(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 1ca987add2..41689c94a3 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -996,6 +996,8 @@ sub getIndexes{ > 'Conference-name-seealso', > 'Content-type', > 'Control-number', >+ 'Control-number-identifier', >+ 'cni', > 'copydate', > 'Corporate-name', > 'Corporate-name-heading', >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 2a0775d386..ab292b1379 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -81,6 +81,7 @@ our %index_field_convert = ( > 'nt' => 'note', > 'notes' => 'note', > 'rcn' => 'record-control-number', >+ 'cni' => 'control-number-identifier', > 'su' => 'subject', > 'su-to' => 'subject', > #'su-geo' => 'subject', >diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml >index 292e9ac475..1ed5be86f9 100644 >--- a/admin/searchengine/elasticsearch/mappings.yaml >+++ b/admin/searchengine/elasticsearch/mappings.yaml >@@ -3279,6 +3279,15 @@ biblios: > sort: ~ > suggestible: '' > type: '' >+ control-number-identifier: >+ label: control-number-identifier >+ mappings: >+ - facet: '' >+ marc_field: 003 >+ marc_type: marc21 >+ sort: ~ >+ suggestible: '' >+ type: '' > record-source: > label: record-source > mappings: >diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att >index d14d617f93..57df88386b 100644 >--- a/etc/zebradb/biblios/etc/bib1.att >+++ b/etc/zebradb/biblios/etc/bib1.att >@@ -221,6 +221,7 @@ att 9010 cn-suffix > att 9011 Suppress > att 9012 Identifier-other > att 9013 not-onloan-count >+att 9014 Control-number-identifier > > # Items Index > att 8001 withdrawn >diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties >index 5c003d301d..53f042c184 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -996,6 +996,9 @@ llength 1=llength > Summary 1=Summary > not-onloan-count 1=9013 4=109 > >+Control-number-identifier 1=9014 >+cni Control-number-identifier >+ > ### > # Items Index > withdrawn 1=8001 >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 c8bd60eaa4..660e087973 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -16,6 +16,9 @@ > <index_control_field tag="001"> > <target_index>Control-number:w</target_index> > </index_control_field> >+ <index_control_field tag="003"> >+ <target_index>Control-number-identifier:w</target_index> >+ </index_control_field> > <!--record.abs line 44: melm 005 Date/time-last-modified--> > <index_control_field tag="005"> > <target_index>Date/time-last-modified: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 72bc7f0b09..ec11e961a0 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -62,6 +62,11 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:value-of select="."/> > </z:index> > </xslo:template> >+ <xslo:template match="marc:controlfield[@tag='003']"> >+ <z:index name="Control-number-identifier:w"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:template> > <xslo:template match="marc:controlfield[@tag='005']"> > <z:index name="Date/time-last-modified:w"> > <xslo:value-of select="."/> >-- >2.20.1
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 28830
:
123616
|
123697
|
123920