Bugzilla – Attachment 116087 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: We should sort callnumber based on cn-sort
Bug-26051-We-should-sort-callnumber-based-on-cn-so.patch (text/plain), 2.49 KB, created by
David Nind
on 2021-01-30 00:34:43 UTC
(
hide
)
Description:
Bug 26051: We should sort callnumber based on cn-sort
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-01-30 00:34:43 UTC
Size:
2.49 KB
patch
obsolete
>From 44bf0dc83d98b4cdf507294943a9d676e0f0d30e 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: 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! > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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 d551ad93c1..7addc5313f 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -694,7 +694,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 07861c7f28..a66c039af2 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -703,7 +703,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' >@@ -714,7 +714,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