I've got records in Algolia containing an array attribute with integer values, like :
{
...
choice_ids: [1, 99, 100, 200]
...
}
I want to filter all records containing any value of another array. For example I search for [1, 300, 400, 600, 700], I should get the record on top because it contains 1.
Should I construct the filter with OR arguments or is there a better way?
Should I construct the filter with OR arguments or is there a better way?
Yes that's the way to go.
index.search('....', { filters: '(choice_ids=1 OR choice_ids=99 OR choice_ids=100 OR choice_ids=200)' });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With