Redis Booksleeve Weight option for SortedSets.UnionAndStore?

126 views Asked by At

I have am building an alert mechanism using Booksleeve and Redis. Currently I'm to the point where I have a sorted set that contains items (call it set A) I want to report on and a sorted set that has members that I want to exclude from alerts (call it set B). Because there is no ZDIFF option in Redis I was thinking of taking unioning to the two sets (call it set C), and by using the WEIGHT option I could drop the scores of the items in set B to less than zero. Then I could remove all members from set C where score was less than 0. But I do not see a way to apply WEIGHT in booksleeve. Am I just misunderstanding how it works? I'm open to other ways of handling the issue.

1

There are 1 answers

0
Marc Gravell On BEST ANSWER

WEIGHTS is not currently supported in booksleeve - an oversight; it shouldn't be tricky to add, though. As a temporary workaround you can probably use LUA (.Scripting.Eval) to invoke it. Not pretty, granted.