Bugzilla – Attachment 114957 Details for
Bug 26051
Elasticsearch uses the wrong field for callnumber sorting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26051: [alternate] We should sort callnumber based on cn-sort
Bug-26051-alternate-We-should-sort-callnumber-base.patch (text/plain), 2.39 KB, created by
Nick Clemens (kidclamp)
on 2021-01-08 13:17:40 UTC
(
hide
)
Description:
Bug 26051: [alternate] We should sort callnumber based on cn-sort
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-01-08 13:17:40 UTC
Size:
2.39 KB
patch
obsolete
>From 132bae16a136eba20c40a32c64e1bccb8c190aa9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 8 Jan 2021 13:14:42 +0000 >Subject: [PATCH] Bug 26051: [alternate] We should sort callnumber based on > cn-sort > >In zebra we sort by callnumber using 8007 cn-sort > >We should do the same in elasticsearch > >To test: >1 - Have Koha using Elasticsearch >2 - Perform a search >3 - Attempt to sort by callnumber >4 - Error in logs: No mapping found for [local-classification__sort] >5 - Apply patch >6 - Restart all >7 - Perform a search and sort by callnumber >8 - Success! >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 2 +- > t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 08e4817eb6..25faafb025 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -589,7 +589,7 @@ sub _convert_sort_fields { > my %sort_field_convert = ( > acqdate => 'date-of-acquisition', > author => 'author', >- call_number => 'local-classification', >+ call_number => 'cn-sort', > popularity => 'issues', > relevance => undef, # default > title => 'title', >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index e62e57f4e4..0518611f84 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -696,7 +696,7 @@ subtest "_convert_sort_fields() tests" => sub { > is_deeply( > \@sort_by, > [ >- { field => 'local-classification', direction => 'asc' }, >+ { field => 'cn-sort', direction => 'asc' }, > { field => 'author', direction => 'desc' } > ], > 'sort fields should have been split correctly' >@@ -707,7 +707,7 @@ subtest "_convert_sort_fields() tests" => sub { > is_deeply( > \@sort_by, > [ >- { field => 'local-classification', direction => 'asc' }, >+ { field => 'cn-sort', direction => 'asc' }, > { field => 'author', direction => 'desc' } > ], > 'sort fields should have been split correctly' >-- >2.11.0
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 26051
:
107237
|
114707
|
114957
|
115662
|
115664
|
116086
|
116087
|
116295
|
117165
|
117166