Bugzilla – Attachment 167188 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: [Alternate] Do a locale-based sort for ES facet names
Bug-36947-Alternate-Do-a-locale-based-sort-for-ES-.patch (text/plain), 1.71 KB, created by
David Cook
on 2024-05-27 07:08:54 UTC
(
hide
)
Description:
Bug 36947: [Alternate] Do a locale-based sort for ES facet names
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-05-27 07:08:54 UTC
Size:
1.71 KB
patch
obsolete
>From a602b821b1a23c545ab3682109cad24d81d75352 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 27 May 2024 07:03:21 +0000 >Subject: [PATCH] Bug 36947: [Alternate] Do a locale-based sort for ES facet > names >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This change causes the locale system to be used when sorting >for ES facet names. > >Test plan: >0. Apply the patch >1. vi "/etc/default/koha-common" >2. Add the following to the bottom of the file: >export LC_ALL=fi_FI.UTF-8 >3. koha-plack --restart koha-common >4. Setup some test records with authors with accented and unaccented names, > and different cases for the lead letter >e.g. Aa author, Ãa author2, aa author3, étienne >5. Switch to using Elasticsearch and reindex >koha-elasticsearch -b -v --rebuild kohadev >6. Do a test search > e.g. http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=test >7. Confirm the facet names are sorted in ascending order following >Finnish collation rules > e.g. >Aa author >aa author3 >étienne >Farley, David >Humble, Jez >Martin, Robert C. >Ãa author > >NOTE: Any collation and language can be used. Finnish is just >an example of a Latin-based script which has a different >alphabetical ordering than just A-Z >--- > Koha/SearchEngine/Elasticsearch/Search.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 54e6e644dc..9a770dd5c9 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -438,6 +438,7 @@ C<au>, C<su-to>, etc. > =cut > > sub _convert_facets { >+ use locale; > my ( $self, $es, $exp_facet ) = @_; > > return if !$es; >-- >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