Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(facets): add a new option "facetOrdering" to Menu, RefinementList & HierarchicalMenu #3067

Merged
merged 2 commits into from Jul 5, 2021

Commits on Jul 2, 2021

  1. feat(facetOrdering): add a new option "facetOrdering" to Menu, Refine…

    …mentList & HierarchicalMenu
    
    If `facetOrdering` is enabled (the default behaviour), before the default sortBy is used, the result from renderingContent.facetOrdering.values is first checked. If that's present, it will be used to sort the items.
    
    You can still change that ordering afterwards with the existing transformItems, so if you are sorting in transformItems, you actually override the sorting done by facet ordering, and won't see the effect. To use facetOrdering, you thus need to remove any sorting done in transformItems.
    
    If there is a facetOrdering present in the index, but you don't want to use it for a certain widget, you need to explicitly pass `facetOrdering: false` to the widget or connector
    
    References:
    - [RFC 45](https://github.com/algolia/instantsearch-rfcs/blob/master/accepted/flexible-facet-values.md)
    - algolia/instantsearch#4784
    - algolia/algoliasearch-helper-js#822
    Haroenv committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    a1c508a View commit details
    Browse the repository at this point in the history
  2. clarify

    Haroenv committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    cc6f07c View commit details
    Browse the repository at this point in the history