我面临着以下问题。假设您在elasticsearch中有一个索引对一个超市进行建模。每次顾客购物时,你都有一个文档。所以,
customer1, [list of bougth items], timestamp
customer2, [list of bougth items], timestamp
customer3, [list of bougth items], timestamp
customer2, [list of bougth items], timestamp
现在,顾客可能一生中只来一次商店,或者他每周或每天都来。所以我记录了他买东西的时间戳。我想计算一下顾客购买商品的“平均循环时间”。例如,如果客户在9月1日、9月7日和9月30日购买,他的平均循环时间为:第一个间隔:7天第二个间隔: 23天平均循环时间:(23+7)/2 = 15天。
你知道可以帮助我找出这个统计数据的聚合吗?问题是,对我来说,我只有购买当天的时间戳,而我没有连续购买之间的差异。
谢谢大家。
发布于 2015-10-02 00:29:00
不幸的是,我不认为这是可能的。
https://stackoverflow.com/questions/32886406
复制相似问题