Sorting Data by Date Range in Typesense
TLDR Aravinda asked about sorting data using Typesense. Jason suggested using Unix timestamp, then sorting by that field. Aravinda experienced difficulties implementing this.
Powered by Struct AI
3
12mo
Oct 26, 2022 (12 months ago)
Aravinda
Aravinda
12:43 PM@here can we sort the data based on date range in typesense ??
Jason
Jason
03:25 PMYup, you want to store the dates as Unix timestamp in an int64 field in Typesense, and then you can use sort by that numerical field using
sort_by
Oct 27, 2022 (12 months ago)
Aravinda
Aravinda
06:30 AMhi Jason I had tried .but faced problem .this is the correct way ??
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2779 threads (79% resolved)
Similar Threads
Sorting "datetime" with Typesense
em1nos asked about sorting "datetime" type in Typesense. Kishore Nallan suggested storing it as an int64 value.
3
28mo
Solved
Handling Javascript Date Types
gab asked for advice on handling Javascript date types, and Jason recommended using a unix timestamp int64 field.
3
29mo
Solved
Converting Firestore Timestamps to Dates in Typesense
Andrew asked about converting Firestore integer timestamps in Typesense back to dates. Jason and Kishore Nallan confirmed they're unix timestamps and suggested using a date formatting library.
4
11mo
Solved