app/models/blacklight/solr/facet_paginator.rb in blacklight-5.19.2 vs app/models/blacklight/solr/facet_paginator.rb in blacklight-6.0.0.pre1
- old
+ new
@@ -15,13 +15,17 @@
# options:
# :limit => number to display per page, or (default) nil. Nil means
# display all with no previous or next.
# :offset => current item offset, default 0
# :sort => 'count' or 'index', solr tokens for facet value sorting, default 'count'.
- def initialize(all_facet_values, arguments)
+ def initialize(all_facet_values, arguments = {})
super
# count is solr's default
- @sort ||= 'count'
+ @sort ||= if @limit.to_i > 0
+ 'count'
+ else
+ 'index'
+ end
end
end
end