Sorting and renaming faceted navigation categories
|this article applies to Funnelback 15.10 and earlier. In Funnelback 15.12 sorting is natively supported and discussed in the faceted navigation documentation.|
Sometimes there is a need to present a different category name to the user that what was generated from the source data or to sort the categories in a different order.
There are a few techniques that can be used to achieve this.
Arguably the best approach - this involves updating the source content to have the correct labels. This isn’t always possible though as you often have no control over the source content.
The technique involves modifying the data that has been gathered so that the indexer stores the correct labels within the index.
This can be achieved by writing a crawl (groovy) filter that corrects the labels as the files are gathered.
Another technique is to alter the category names as they are being presented. The method of implementing this depends on the UI that is being used.
A user interface hook script can be used to update the category labels that are stored in the Modern UI data model.
post_process_hook.groovy script included with the replacement faceted navigation GitHub project to rename categories.
<s:CategoryRename> form tag to rename categories.
In Funnelback 15.12 and newer sorting is natively supported and discussed in the faceted navigation documentation.
For sorting of date facets (v13+) use the faceted_navigation.date.sort_mode collection.cfg option.
For other facets or arbitrary sorting on a date facet, a hook scricpt can be used to alter the sort order in the Modern UI.
post_process_hook.groovy script included with the replacement faceted navigation macros.
Once installed sorting is configured, per facet, using