Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/recommendify/cc_matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ def ccmatrix

def add_set(set_id, item_ids)
# FIXPAUL: forbid | and : in item_ids

item_ids.each do |item_id|
item_count_incr(item_id)
end
all_pairs(item_ids).map do |pair|
i1, i2 = pair.split(":")
ccmatrix.incr(i1, i2)
Recommendify.redis.pipelined do
all_pairs(item_ids).map do |pair|
i1, i2 = pair.split(":")
ccmatrix.incr(i1, i2)
end
end
end

Expand Down