From 623a81eb24322aeb947df1f8a154c645105c39c3 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 Content-Type: text/plain; charset=utf-8 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. Signed-off-by: Roman Dolny Signed-off-by: Marcel de Rooy --- 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 c5596f2e99..f36264e423 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 f1bfdbe916..d3c8798b6f 100644 --- a/admin/searchengine/elasticsearch/mappings.yaml +++ b/admin/searchengine/elasticsearch/mappings.yaml @@ -2657,7 +2657,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 e4f6638743..4c8deeb929 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -418,6 +418,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.5