Apply Global Filters on every query

Hi all, I would like to pre-filter all my queries by an attribute. As far as I can see the only way is to implement the searchFunction method of the Algolia config. The only problem is that the algolia helper does not allow me to add filters.

What can I do to achieve this?

Hi there,

If you want to have a filter active for all queries, you can simply set it up a static filter in your front end code. It will apply to every query.

InstantSearch.js

instantsearch.widgets.configure({
  filters: 'category:Book',
});

Documentation

React InstantSearch

<Configure
  filters="category:Book"
/>

Documentation

Angular InstantSearch

<ais-configure
  [searchParameters]="{ filter: 'category:Book' }"
></ais-configure>

Documentation

Vue InstantSearch

<ais-configure
  :filters="category:Book"
/>

Documentation

Best,

Hi @sarah.dayan thanks for the feedback!