From 736f3989c645cb9e80ce34edcfe201e01dde26ed Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 26 May 2010 18:01:43 +0200 Subject: [PATCH] sort numeric facets with more than 5 values ascending This heuristics allow us to see simple yes/no/maybe lists still as a count, especially if they are numeric --- lib/MojoFacets/Data.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 65aef48..dee9765 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -603,7 +603,8 @@ sub facet { my $numeric = $self->_is_numeric($name); my $sort = $self->param('sort'); - $sort ||= $numeric ? 'a' : 'c'; + # sort numeric facets with more than 5 values ascending + $sort ||= $numeric && $#facet_names > 4 ? 'a' : 'c'; @facet_names = sort { my $result; -- 2.20.1