Browse Source

Bug 18213: (follow-up) Correctly sort facets

Previously we sorted alphabetically - that works for 1-9.
With a 10th facet category we should sort numerically

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens 6 years ago
parent
commit
13ca80c20b
  1. 2
      Koha/SearchEngine/Elasticsearch/Search.pm

2
Koha/SearchEngine/Elasticsearch/Search.pm

@ -509,7 +509,7 @@ sub _convert_facets {
push @facets, $facet if exists $facet->{facets};
}
@facets = sort { $a->{order} cmp $b->{order} } @facets;
@facets = sort { $a->{order} <=> $b->{order} } @facets;
return \@facets;
}

Loading…
Cancel
Save