I am looking for a way to search in Algolia a record where at least one element of an array meets several conditions. As an example, imagine this kind of record:
{
"name": "Shoes",
"price": 100,
"prices": [
{
"start": 20160101,
"end": 20160131,
"price": 50,
},
{
"start": 20160201,
"end": 20160229,
"price": 80,
}
]
}
I am looking for a way to do a query like the following:
prices.price<60 AND prices.start<=20160210 AND prices.end>=20160210
(A product where the price is less than 60 for the given date)
That query should not return anything because the price condition is not met for that date but the record is returned anyway. Probably because the condition is met "globally" among all prices.
I am a beginner with Algolia and trying to learn. Is there a way I can do the desired request or will I have to go for a separate index for prices and use multiple queries?
Thanks.