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.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Janusz Kaczmarek 2024-05-29 19:40:45 +00:00 committed by Katrin Fischer
parent c8a5bdffbe
commit eab94d1213
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
4 changed files with 10 additions and 7 deletions

View file

@ -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 {

View file

@ -2657,7 +2657,7 @@ biblios:
label: local-classification
mandatory: ~
mappings:
- facet: ''
- facet: 1
marc_field: 952o
marc_type: marc21
sort: 0

View file

@ -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

View file

@ -418,6 +418,8 @@
[% ELSE %]<option value="sn">ISBN</option>[% END %]
[% IF ( header_pulldown == "ms_ss" ) %]<option selected="selected" value="ss">ISSN</option>
[% ELSE %]<option value="ss">ISSN</option>[% END %]
[% IF ( header_pulldown == "ms_callnum" ) %]<option selected="selected" value="callnum">Call number</option>
[% ELSE %]<option value="callnum">Call number</option>[% END %]
</select>
[% IF ( scan_search_term_to_use ) %]
<input type="text" name="q" id="scan-index-term" size="35" value="[% scan_search_term_to_use | html %]" />