View | Details | Raw Unified | Return to bug 23089
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch.pm (+1 lines)
Lines 832-837 sub _get_marc_mapping_rules { Link Here
832
832
833
        if ($type eq 'sum') {
833
        if ($type eq 'sum') {
834
            push @{$rules->{sum}}, $name;
834
            push @{$rules->{sum}}, $name;
835
            push @{$rules->{sum}}, $name."__sort" if $sort;
835
        }
836
        }
836
        elsif ($type eq 'isbn') {
837
        elsif ($type eq 'isbn') {
837
            push @{$rules->{isbn}}, $name;
838
            push @{$rules->{isbn}}, $name;
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-3 lines)
Lines 992-1000 sub _sort_field { Link Here
992
    my $textField = defined $mappings->{data}{properties}{$f}{type} && $mappings->{data}{properties}{$f}{type} eq 'text';
992
    my $textField = defined $mappings->{data}{properties}{$f}{type} && $mappings->{data}{properties}{$f}{type} eq 'text';
993
    if (!defined $self->sort_fields()->{$f} || $self->sort_fields()->{$f}) {
993
    if (!defined $self->sort_fields()->{$f} || $self->sort_fields()->{$f}) {
994
        $f .= '__sort';
994
        $f .= '__sort';
995
        # We need to add '.phrase' to text fields, otherwise it'll sort
996
        # based on the tokenised form.
997
        $f .= '.phrase' if $textField;
998
    } else {
995
    } else {
999
        # We need to add '.raw' to text fields without a sort field,
996
        # We need to add '.raw' to text fields without a sort field,
1000
        # otherwise it'll sort based on the tokenised form.
997
        # otherwise it'll sort based on the tokenised form.
(-)a/admin/searchengine/elasticsearch/field_config.yaml (-1 / +1 lines)
Lines 65-67 sort: Link Here
65
  default:
65
  default:
66
    type: icu_collation_keyword
66
    type: icu_collation_keyword
67
    index: false
67
    index: false
68
- 
68
    numeric: true

Return to bug 23089