mahemoff
mahemoff

Reputation: 46389

How to store dates/times in RediSearch

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?

Upvotes: 6

Views: 1452

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 49942

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

Upvotes: 4

Related Questions