How to store dates/times in RediSearch
Asked Answered
J

1

6

I've read that RediSearch has support for dates and times via the "numeric" type, but there's not much information about this. Does this mean I just choose my own conversion from time, such as seconds since 1970?

Juvenescence answered 1/10, 2018 at 20:9 Comment(0)
T
4

Yep, exactly that (a.k.a epoch and timestamp).

You can also define your own epoch and timestamp resolution if you want, like "days since January 1 2018", as long as you convert to and from real times.

Also, the aggregation API has a bunch of functions augmenting dealing with timestamps. See https://oss.redislabs.com/redisearch/Aggregations/#list%22_%22of%22_%22datetime%22_%22apply%22_%22functions

Thibaut answered 1/10, 2018 at 21:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.