Filtering results by dates when dates are not as simple as one specific date

I am build a rental service. Users need to be able to find items by price, keyword, location, and date. The first 3 are easily handled by Algolia filters. But date is giving me a hard time.

Dates can be updated by renters at any point and there may be many sets of dates for each item. In a traditional relational database i’d have a separate table for dates and assign them to an item. Then i could pull items with matching dates.
Any idea how i could do something like this in an Aloglia search?

Should i just pull down all results and then do the filtering after aloglia has provided results, then display what matches the date ranges to users? If i do this i loose the ability to do pagination is my searches and i’d have to request all the hits at once - right?

Any help would be greatly appreciated.

Also, this is my first time using Algolia for a search project and i’m really liking it. Great job Algolia Team!

Hello Mike,

Thank you for contacting us. Actually this is quite easy to do with Algolia.
In your records, you can use an array of dates (more precisely an array of unix timestamps) in an attribute:

	"price": 99.99,
	"keyword": "foo"
	"location": "New York",
	"dates": [1435735848, 1435733828]

When you filter on the “dates” attribute, if any date matches, it will return the record.

Don’t hesitate to contact us again if you have any other questions!