Bugzilla – Attachment 69214 Details for
Bug 19563
Generation of sort_fields uses incorrect condition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19563: Followup - Restore checking sort variable
Bug-19563-Followup---Restore-checking-sort-variabl.patch (text/plain), 1.80 KB, created by
David Bourgault
on 2017-11-17 22:17:52 UTC
(
hide
)
Description:
Bug 19563: Followup - Restore checking sort variable
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-11-17 22:17:52 UTC
Size:
1.80 KB
patch
obsolete
>From f378203bba28d660b6f3b3e495cc8ac52c801b88 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 17 Nov 2017 12:13:55 +0000 >Subject: [PATCH] Bug 19563: Followup - Restore checking sort variable > >This code seems a bit odd, $self->sort_fields()->{$name} is checking if >there is any mapping in ES for a field, so if one marc field in an index >is marked as sortable this will exists. We need to check the individual >marc field to see if it should be added to the sort index here. > >If you apply the first patch, reindex, and view a record in es: >curl -XGET 'localhost:9200/koha_kohadev_biblios/data/19/?pretty' | grep >-A 10 author__sort > >You will see that 245$c is included in the record without that >additional check > >Apply this, reindex again, and that field should not be included > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> >--- > Koha/SearchEngine/Elasticsearch.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 2b2fd10..85a20a9 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -297,7 +297,6 @@ sub reset_elasticsearch_mappings { > # sort_fields isn't set, then it'll generate it. > sub sort_fields { > my $self = shift; >- > if (@_) { > $self->_sort_fields_accessor(@_); > return; >@@ -348,7 +347,9 @@ sub get_fixer_rules { > push @rules, "sum('$name')"; > } > if ($self->sort_fields()->{$name}) { >- push @rules, "marc_map('$marc_field','${name}__sort.\$append', $options)"; >+ if ($sort || !defined $sort) { >+ push @rules, "marc_map('$marc_field','${name}__sort.\$append', $options)"; >+ } > } > } > ); >-- >2.7.4
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 19563
:
68889
|
69191
|
69192
|
69212
|
69213
|
69214
|
69640
|
69641
|
69642