I am trying to create a redis ordered set . Capture is the need for ordering based on two criteria, timestamp and evaluation. But in redis, I can provide only one search criteria:
ZADD {key} {timestamp} {value}
How to add an invoice to this order as well as plz?
Update: Here is the approach I took to combine two different ordering factoring into a single floating point value:
var score = Math.floor(result.created_time/(60*60*24*1000)); score = score + (result.matches/10);
Just to explain, I first converted the timestamp to the number of days. And my match value is usually 0-10. Thus, it is converted to a decimal value and added as the weight of the fraction. Which gives me the highest scored entries sorted per day. This is exactly what I need.
Rana source share