-
Notifications
You must be signed in to change notification settings - Fork 289
Closed
Description
I couldn't find a way how to properly stack up the count of union matches to the calculation.
This is what I theoretically need:
// a set of keys
keys = [ .... ];
// initial weights to 1
weights = [ 1, 1, 1, ....];
// store union with COUNT as the new score
redis.zUnionStore(dest, keys, { AGGREGATE: "COUNT" });
// push the destination to the keys
keys.push(dest);
// add some high value to the weights to prefer the
// ordering based on count over the sum of score
weights.push(999);
// calculate final results with the right ordering
redis.zUnionStore(dest, keys, { WEIGHTS: weights, AGGREGATE: "SUM" });In SQL something simliar is ORDER BY count DESC, score DESC
Is there a chance to add such functionality to the library? Thanks in advance
Metadata
Metadata
Assignees
Labels
No labels