@@ -, +, @@ -A 10 author__sort --- Koha/SearchEngine/Elasticsearch.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/Koha/SearchEngine/Elasticsearch.pm +++ a/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)"; + } } } ); --