Algolia numeric filter OR

1k views Asked by At

We are using Algolia for our search engine. In one index we have an attribute : contract.monthDuration, which contains intergers.

I use the following numeric filter with success :

"contract.monthDuration:0 to 3"

But I am unable to use something like

"contract.monthDuration:0 to 3" OR "contract.monthDuration:4 to 6"

I have tried :

"contract.monthDuration:0 to 3 OR contract.monthDuration:4 to 6"
"contract.monthDuration:0 to 3,4 to 6"
"contract.monthDuration:0 to 3, contract.monthDuration:4 to 6"
"(contract.monthDuration:0 to 3, contract.monthDuration:4 to 6)"
1

There are 1 answers

0
Hugo On

The correct syntax is

"(contract.monthDuration:0 to 3, contract.monthDuration:4 to 6)"

It actually works when using the JS API, but doesn't when one tests it directly in the algolia dashboard.