Quick question! How many filters do algolia recommend upon retrieving result?

How many conjunction of disjunctions do you guys recommend?

Can I do something like the following?:

filters: { filter1 AND filter2 AND filter3 AND filter4 }

filters: { (filter1 AND filter2 ) OR (filter3 AND filter4) }

filters: { (filter1 AND filter2 ) OR (filter3 AND filter4) OR (filter5 AND filter6) }

Hey @markdaniel_tamayo,

Here’s a quick extract from the docs:

For performance reasons, filter expressions are limited to a disjunction of conjunctions. In other words, you can have ANDs of ORs (e.g. filter1 AND (filter2 OR filter3)), but not ORs of ANDs (e.g. filter1 OR (filter2 AND filter3).

As long as you respect that rule you can have as many condition as you want.

If you need to do “ANDs of ORs” you should try to pre-compute some of the conditions where possible.
The less Algolia needs to filter on, the faster the responses will be.

Here is a link to the corresponding docs: https://www.algolia.com/doc/api-reference/api-parameters/filters/

I hope that helps,