CuriousLayman
CuriousLayman

Reputation: 217

Redis Booksleeve Weight option for SortedSets.UnionAndStore?

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.

Upvotes: 1

Views: 126

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062955

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.

Upvotes: 0

Related Questions