Skip to content

How to perform OR operation between attributes in React Instantsearch #6531

Answered by Haroenv
callmekatootie asked this question in Q&A
Discussion options

You must be logged in to vote

In React InstantSearch all widgets are indeed implicitly "and"ed. You have two options:

  1. you are using no other widgets like refinementList, menu, hierarchical menu:

Then you can use the facetFilters search parameter, formatted like [["foo:value1"],["bar:value2"]]

  1. You do have other refinement widgets

Then you use the filters parameter, formatted like foo:value1 OR bar:value2

InstantSearch, or even the underlying helper does not have a way to do disjunctions across different attributes. Often a solution can be found where you for example merge both into one list, or other UIs. People in general expect filters to be joined conjunctively, but your UI may work differently.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@callmekatootie
Comment options

@Haroenv
Comment options

Answer selected by callmekatootie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants