From b10b1653e6b36ed5534a5cd1163534e2fbc0bab6 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Wed, 29 May 2024 19:40:45 +0000 Subject: [PATCH] Bug 36991: Add ability to scan call numbers index/search field Some libraries ask for the ability to scan/browse the call numbers index. Test plan: ========== 1. Have an installation with items with callnumbers (in ktd with standard test data set: add some callnumbers to the items). 2. Go to Advanced search > More options; choose Call number in the first drop list and mark Scan indexes. Enter one of the call numbers you assigned to the items and perform the search. You should get no results. 3. Apply the pach; restart all; when using ES: koha-elasticsearch --rebuild -r -d kohadev 4. Repeat p. 2. You should get a list with at least one call number. The link should lead you to the record(s) with items with the selected call number. This should work for ES and for Zebra, but for Zebra you would need to replace /etc/koha/zebradb/ccl.properties with the repository version; and you will get one token results on the list, like for other indexes. --- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 11 ++++++----- admin/searchengine/elasticsearch/mappings.yaml | 2 +- etc/zebradb/ccl.properties | 2 +- .../prog/en/modules/catalogue/results.tt | 2 ++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm index ac161e50fd..6b35f14f4a 100644 --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -635,11 +635,12 @@ the provided string input. =cut our %scan_field_convert = ( - 'ti' => 'title', - 'au' => 'author', - 'su' => 'subject', - 'se' => 'title-series', - 'pb' => 'publisher', + 'ti' => 'title', + 'au' => 'author', + 'su' => 'subject', + 'se' => 'title-series', + 'pb' => 'publisher', + 'callnum' => 'local-classification', ); sub _build_scan_query { diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml index 929f2f9410..77d9152cf3 100644 --- a/admin/searchengine/elasticsearch/mappings.yaml +++ b/admin/searchengine/elasticsearch/mappings.yaml @@ -2606,7 +2606,7 @@ biblios: label: local-classification mandatory: ~ mappings: - - facet: '' + - facet: 1 marc_field: 952o marc_type: marc21 sort: 0 diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties index 985f7391bc..a71ea8f4c4 100644 --- a/etc/zebradb/ccl.properties +++ b/etc/zebradb/ccl.properties @@ -1039,7 +1039,7 @@ stack 1=8018 issues 1=8019 renewals 1=8020 reserves 1=8021 -Local-classification 1=8022 +#Local-classification 1=8022 barcode 1=8023 bc barcode onloan 1=8024 14=1 diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 91db336895..6ad76edf67 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -417,6 +417,8 @@ [% ELSE %][% END %] [% IF ( header_pulldown == "ms_ss" ) %] [% ELSE %][% END %] + [% IF ( header_pulldown == "ms_callnum" ) %] + [% ELSE %][% END %] [% IF ( scan_search_term_to_use ) %] -- 2.39.2