Do you know if RediSearch Aggregations supports ranges? If so, how can I accomplish this?
I have multiple users in my RediSearch index with one field being Age. Now I want to do an aggregation on age, a count, but I want the result being Age ranges: eg: 0 - 10 years, 10 - 20 years, 20 - 30 years etc.
I can’t see how it’s possible now, but I don’t see why it shouldn’t be possible in the future fairly simply. The result of the age grouping would need to be passed along as input to GROUPBY which in turn would group based on the contents of that field. Right now we do this for timestamps (where we can produce the year, day, month, etc. of a given timestamp into a value).
Mark Nunberg | Senior Software Engineer Redis Labs - home of Redis
Can you explain how you would reduce them? 1to3 and 4to7 etc. are distinct fields, but groupby works on values Mark Nunberg | Senior Software Engineer Redis Labs - home of Redis
Very clever, so basically you assign different numerical values based on the boolean-to-integer result of the conditional expressions. He would still need to map them though Mark Nunberg | Senior Software Engineer Redis Labs - home of Redis
Yup. It’s not straightforward, but it’s do-able. I would put upper and lower bounds on this thing just so you don’t get a range 0. YMMV with performance but seems to be decent in a moderate (121k) data set.