]> git.koha-community.org Git - koha.git/commit
Bug 29632: Don't sort cn-sort numerically
authorNick Clemens <nick@bywatersolutions.com>
Tue, 28 Jun 2022 13:47:45 +0000 (13:47 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 23 Aug 2022 17:35:16 +0000 (17:35 +0000)
commit256ef4ee27197c3ee8d1c331d4fe6d3b97e76286
treec00fc458d3e44dd970b5074d463f005a77f8dbc0
parente64d282b3ad0f0b927f038d98bcda763f74cc4a1
Bug 29632: Don't sort cn-sort numerically

When defining our sort fields in we defined all as 'numeric'

For other string containing numbers this is likely correct, however,
for callnumbers it is not. e.g. E45 should sort before E7

This patch adds a new 'callnumber' type and deifnes this for cn-sort and
adds to the field maping a sort without numeric set

To test:
0 - Be using ES with Koha
1 - On records with single item, add callnumbers:
    VA65 E7 R63 1984
    VA65 E7 T35 1990
    VA65 E45 R67 1985
2 - Add public note 'shrimp' or something to make them easily searchable as a group
3 - Search for 'shrimp', sort by callnumber
4 - Note E45 comes last, it should come first
5 - Apply patch
6 - Reset ES mappings
7 - Reindex ES
8 - Repeat search
9 - Sorting should be correct when set to callnumber

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b8b8a62f112dc6937a7187d4150146a7cad6941f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch.pm
admin/searchengine/elasticsearch/field_config.yaml
admin/searchengine/elasticsearch/mappings.yaml
installer/data/mysql/atomicupdate/bug_29632.pl [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt