Package io.goobi.viewer.model.search
Class FacetSorting
java.lang.Object
io.goobi.viewer.model.search.FacetSorting
Class to create maps for facet values and their respective counts which are automatically sorted according to a given sort order. The maps are
returned as a SortedMap class to signal that the map takes care of sorting its members
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A map container indicating the the contained map is created using one of the getSortedMap methods -
Method Summary
Modifier and TypeMethodDescriptionstatic FacetSorting.SortingMap<String,
Long> getSortingMap
(String field, String sortOrder, Locale locale) Creates a SortingMap on the basis of the given field and locale and the given sortOrder.static final FacetSorting.SortingMap<String,
Long> getSortingMap
(Map<String, Long> map, String sortOrder) Creates a SortingMap on the basis of the given map and with the given sortOrder.
-
Method Details
-
getSortingMap
public static final FacetSorting.SortingMap<String,Long> getSortingMap(Map<String, Long> map, String sortOrder) Creates a SortingMap on the basis of the given map and with the given sortOrder. Possible values for sortOrder are- numerical
- alphabetical
- alphanumerical
- alphabetical_raw
- Parameters:
map
- Map containing values to sortsortOrder
- sorting order- Returns:
- a SortingMap, which automatically orders entries as they are added to the map
-
getSortingMap
public static FacetSorting.SortingMap<String,Long> getSortingMap(String field, String sortOrder, Locale locale) Creates a SortingMap on the basis of the given field and locale and the given sortOrder. Possible values for sortOrder are- numerical
- alphabetical
- alphanumerical
- alphabetical_raw
- Parameters:
field
- The solr-field which values are to be sorted. Affects which configuration options are used for orderingsortOrder
- sorting orderlocale
- the locale to use if translated values are to be used for ordering- Returns:
- a SortingMap, which automatically orders entries as they are added to the map
-