Search-ui single sticky facet

Hello,

I'm aware site-search doesnt support disjunctive facets, but I need this functionality for a single facet box , known values, single select option, 1 filter at the time

I need a simple solution where you can select 1 facet and the others remain and then facet counts update on new searchTerms.

I tried many ways without success :

Tried attaching a raw query in the onSearch function but the state variable does not contain the facet values, only filters so I can not attach the clean facets there

Tried intercepting the setSearch query term change in a state variable but component renders again after the effect and I can not catch the right facets to "cache"

Any advice would be appreciated, I can hard code the facet field names because I know the fields beforehand, I just need to keep track of the facet counts after filtering

thanks

What I did :

  1. Create a SearchProvider inside the main one with a onSearch middleware that reset filters, and url track to false
  2. HOC component inside this nested SearchProvider to handle facets
  3. Pass down setFilter from main provider to handle global filters from child provider

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.