How to apply conjunctive (operator: and) to connectRefinementList

My code is taken straight from the docs example but the refinements are applied disjunctive as logical OR. I need to filter down the facet list and results within my custom widgets. I’ve looked for examples or posts about this to no avail. Would like to stay within react-instantsearch if possible. Can anyone point me in the right direction please!

I’m trying desperately to add my code but get a 403 forbidden…

Hi @supplies could you provide a codesandbox to demonstrate the issue? We have a starter template here.

The refinementList widget has an operator option which allows you to choose disjunctive or conjunctive.

1 Like

Sure,
and yes I want to do exactly that BUT in a customized widget using connectRefinementList

Notice that if you select two filters, your result set expands where I would want conjunctive behavior when selecting two filters. Obviously in this case that wouldn’t make sense as these filter values are mutually exclusive. But the core concept remains, I want the conjunctive AND behavior for my connectRefinementLists powered widget.

Hey @supplies,

Have you tried the “operator” prop to “and” like this:

I’ve changed the attribute to “categories” to show items that have more than one value, since that is the only way conjunctions make sense!

1 Like

:slightly_smiling_face: :upside_down_face: :slightly_smiling_face: :upside_down_face: :slightly_smiling_face: :upside_down_face:

Wow, I’m…not sure how I missed that. I’m going to blame it on Friday. Thank you for holding my hand on this one! :stuck_out_tongue_closed_eyes:

1 Like