-
Notifications
You must be signed in to change notification settings - Fork 157
numericRefinementList for filtering on date and time for event records #414
Comments
Thanks for bringing this to our attention. We will actually rework the way numeric ranges etc. are working specifically for dates all around InstantSearch in the coming time. Could you for that reason explain which behaviour you exactly want to achieve? i.e. what kind of data you have, how you want to refine etc. Thanks! |
I have a list of events which I would like to filter by date preferably using a calendar UI component.
I stored the date in the index using a numeric timestamp (UNIX time in seconds), and would like to use it as a facet. It looks like the usecase has already been studied using the regular vanilla InstantSearch.js library. The demo is available on https://mycaule.github.io/tango-search/. |
So to be clear, every record in your index has a single timestamp, and you want to have a refinement like this?
with |
Yes indeed. My records look like this:
That way as a developer I expect these filter to be already implemented in vue :
The events search use case is a common use case in my opinion (think of Google Calendar, Meetup.com etc...) Something like https://github.com/airbnb/react-dates would be awesome as mentioned by algolia team members here algolia/instantsearch#1077 |
🤔 Would it also make sense to have both of those things in two timestamps instead: {
"date": {
"from": 1522281600, // 15h, 29/3
"to": 1522281600 // 20h, 29/3
}
} For your use case, if you use the date/time picker, the events need to be completely within the range you give right? You wouldn't want to match things which partially overlap with the range? |
If I want to get every events happening on tuesday at 6pm for the next month, I would not be able to filter with these fields, it would require more calculation. That's why I just store the hours, not the full date + hours unix format. But I agree that it's easier to store the hours as numeric values instead of strings. There is this recommendation if you want to see how to store and event record in a more ideal way http://schema.org/Event I still need a date and time picker which is still not provided by |
I’m aware that Vue InstantSearch doesn’t have this feature yet, I’m just thinking what you exactly need |
Closing this thank you very much. |
We will keep this issue in mind, when we make this a built-in future in the future. Thanks! |
Please implement
numericRefinementList
in the vue version of the library.The goal would be to make a date filter as mentioned in https://discourse.algolia.com/t/filter-by-date-instantsearch/2858
The text was updated successfully, but these errors were encountered: