3

求一个商品热度排序的解决方案

 1 year ago
source link: https://www.v2ex.com/t/897782
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

求一个商品热度排序的解决方案

  Hanggi · 2 小时 52 分钟前 · 502 次点击

目前有商品表和订单表。
订单记录了购买的商品 id 和价格。

为了优化商品流的呈现,要为商品做热度排序:
根据商品的浏览量、收藏量、销售额进行评分排序。

同时为了防止热门的商品一直排在前面,对以上信息添加基于时间的权重。
(比如 7 天内销量权重高,15 天权重减半,30 天权重再减半,超过 30 天就不记录在内)

目前数据在 SQL 数据库中,同时有 Redis 作为缓存使用。

在商品数量不断上升的前提下,有没有比较成熟高效的热度排序方案呢 (暂时不考虑 AI 排序)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK