基于视图/喜欢/不喜欢的趋势产品

Bee*_*tty 3 ruby ruby-on-rails redis

我有一个产品列表,用户可以在其中喜欢和不喜欢该产品。喜欢,不喜欢和查看次数计数存储在 redis 中。

现在,我想根据视图/喜欢和不喜欢获取趋势产品。是否有任何 gem 或 algorthim 。

编辑

存储为product: product_id: followers = [user.id] ie的数据product:4:followers = ["1", "3"]

Bee*_*tty 5

这篇文章给出了正确的解决方案。 http://sorentwo.com/2013/12/30/let-postgres-do-the-work.html