Bugzilla – Attachment 167142 Details for
Bug 36947
Sort Elasticsearch facets according to system locale instead of using Perl's stringwise/bytewise sort
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36947 - Diacritics and lower case letters not taken into account when facets are alphabetized
Bug-36947---Diacritics-and-lower-case-letters-not-.patch (text/plain), 1.30 KB, created by
David Cook
on 2024-05-24 04:36:40 UTC
(
hide
)
Description:
Bug 36947 - Diacritics and lower case letters not taken into account when facets are alphabetized
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-05-24 04:36:40 UTC
Size:
1.30 KB
patch
obsolete
>From 3c6d9e8eed56338893497bb8dfca4096b0423ec8 Mon Sep 17 00:00:00 2001 >From: lmstrand <lmstrand@gmail.com> >Date: Thu, 23 May 2024 16:46:10 +0300 >Subject: [PATCH] Bug 36947 - Diacritics and lower case letters not taken into > account when facets are alphabetized > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 54e6e644dc..3c0d828d4f 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -53,6 +53,7 @@ use MARC::Record; > use MARC::File::XML; > use MIME::Base64 qw( decode_base64 ); > use JSON; >+use Unicode::Normalize; > > Koha::SearchEngine::Elasticsearch::Search->mk_accessors(qw( store )); > >@@ -503,7 +504,7 @@ sub _convert_facets { > } > if( C4::Context->preference('FacetOrder') eq 'Alphabetical' ){ > @{ $facet->{facets} } = >- sort { $a->{facet_label_value} cmp $b->{facet_label_value} } @{ $facet->{facets} }; >+ sort { NFKD(uc($a->{facet_label_value})) cmp NFKD(uc($b->{facet_label_value})) } @{ $facet->{facets} }; > } > push @facets, $facet if exists $facet->{facets}; > } >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36947
:
167110
|
167125
|
167141
|
167142
|
167143
|
167145
|
167146
|
167188
|
167198
|
167880
|
168488
|
170489