From 79071e18f944c2508f99bfadc758769186196cef Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 15 Mar 2018 12:53:13 +0000 Subject: [PATCH] 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 --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 8cd3619..c2c00a1 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -496,7 +496,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; } -- 2.1.4