How to enforce a set of global facet filters that are always applied? #5290
-
My use-case is this: in 'normal' InstantSearch use, my 'states' facet widget allows selection of any combination of all 50 US states. But, based on user-specific configuration, I want to limit the 'state' options to just those that are listed in that user's configuration (e.g. this user can only see items in these three states [ 'California', 'Nevada', 'Arizona' ] and can select one or more of those states from the 'states' facet widget). The other facet options (e.g. 'brand') should reflect the limited set of states (e.g. only list brands that relate to those three states). Ideally this 'global' filter should be applied when querying Algolia, but should not appear in the searchState (and should not set those globally-filtered states as selected in the 'states' facet widget). Can anyone suggest a neat way to implement something like this using react-instantsearch? |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 4 replies
-
A user filter that shouldn't be visible is best done via api key restrictions. You can follow this guide: https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/#method-param-filters Hope that's clear! |
Beta Was this translation helpful? Give feedback.
A user filter that shouldn't be visible is best done via api key restrictions. You can follow this guide: https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/#method-param-filters
https://www.algolia.com/doc/guides/solutions/ecommerce/b2b-catalog-management/tutorials/personalized-catalogs/#implementing-secured-api-keys
Hope that's clear!