From afd4194cdab5b19403e4401f94636446a9c5bc38 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 Signed-off-by: Nicolas Legrand Signed-off-by: Alex Arnaud --- 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 ebdd1f3..2e9112a 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -492,7 +492,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.7.4