Is there a connect widget for multiple numeric ranges?

I have extended a number of widgets with React Instantsearch using the connect methods, for example connectHits, connectRefinementList et al.

My index includes a date attribute, using unix timestamps.

I would like to filter by multiple ranges, for example to query “August 2021 or October 2021” (which does not include September).

Is there a widget I can extend to be able to do this?

Given the above example, I would query both:

  • filters: 'date_timestamp:1629158400 TO 1630454399'
  • filters: 'date_timestamp:1633046400 TO 1635724799'

Hi @marc4, you can use a combined filter like this:

​You can use a filter such as this one:

​{"filters": "(date_timestamp:1629158400 TO 1630454399) OR (date_timestamp:1633046400 TO 1635724799)"}

Thanks @cindy.cullen

And which widget creates this?

Hi @marc4, you can use the configure widget with instantsearch.

Thanks @cindy.cullen

I’m using the Configure widget elsewhere already, also for filters, so presumably this means I’ll have to do some (non-trivial) management of the string used in the filters prop of Configure.

Please bear in mind I’m using the React Instantsearch widgets.

Is it possible to combine React Instantsearch with algoliasearch-helper-js in order to do this? I’ll need to apply multiple filters (not only date) using Configure. Or is some other helper function available when using the React library, in order to avoid manual string interpolation?