typesense / firestore-typesense-search

Firebase Extension to automatically push Firestore documents to Typesense for full-text search with typo tolerance, faceting, and more
https://extensions.dev/extensions/typesense/firestore-typesense-search
Apache License 2.0
159 stars 35 forks source link

How to index Firestore TimeStamp? #15

Closed lbourbon closed 3 years ago

lbourbon commented 3 years ago

First of all, I would like to thank you for this nice project. I'm trying to use a Firebase TimeStamp as the default_sorting_field of my Typesense collection. But it only supports int, float and string. Is it possible to index a Firebase Timestamp? How could this be done? Thanks again

jasonbosco commented 3 years ago

@lbourbon You want to convert the Firebase Timestamp into an int64 epoch/unix timestamp and set in a new field in Firestore, and use that as your default sorting field.

lbourbon commented 3 years ago

Good idea! Thank you!