From deece7b76bd57e7c978b2f74089d0c223bf680b9 Mon Sep 17 00:00:00 2001 From: Martin Renvoize 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 Signed-off-by: Nick Clemens Signed-off-by: Pasi Kallinen Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- 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 72c81ec06c..e26d0a6f87 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 4f19b9cd62..8a42be29d9 100644 --- a/admin/searchengine/elasticsearch/mappings.yaml +++ b/admin/searchengine/elasticsearch/mappings.yaml @@ -3299,6 +3299,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 @@ Control-number:w + + Control-number-identifier:w + Date/time-last-modified: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 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) + + + + + -- 2.39.5