sunliwen / poco

Poco v1.6
0 stars 1 forks source link

[好药师] 推荐类型CustomList工作可能不正常 #62

Open jacobfan opened 10 years ago

jacobfan commented 10 years ago

5 02yglvvbum fd g5i8h o

客户反映:

  1. 这个自定义类型传任何custom_type返回的结果都一样
  2. 拿到的结果中多了内容 "19955", "19954", "1365","2011", "7127" (后三个是不是热销榜?)

读取的方式: rnf2c ckzlllc7 pc3 67

客户传送这个请求设置的custom list: { "action": "set_recommender_items", "api_key": "prod-b02c65ef", "display_name": "11", "item_ids": [ "19955", "19954" ], "type": "hwg_v1_australia_rmtj" }

aoeuidht commented 10 years ago

我去线上自己设置了一个推荐类型,返回的结果是正常的。 具体数据如下:

设置名为「test-custom-list」的自定义推荐类型

curl  'poco.ehaoyao.com/api/v1.6/private/recommender/custom_lists'     -H 'Content-Type: application/json'      -d '{  "api_key": "","item_ids": ["639", "2455"], "type": "test-custom-list", "action": "get_recommender_items"}'

读取自定义推荐的结果

curl 'poco.ehaoyao.com/api/v1.6/public/recommender/?api_key=&type=CustomList&custom_type=hwg_v1_australia_rmt&user_id=u1&amount=10' | python -mjson.tool | grep '"item_id'
            "item_id": "639",
            "item_id": "2455",
            "item_id": "1365",
            "item_id": "2011",
            "item_id": "7127",
            "item_id": "13040",
            "item_id": "10339",
            "item_id": "15474",
            "item_id": "16187",
            "item_id": "17470",

手工设置的两个商品,均排在了最前;数量不足的, 使用了热门商品进行补充

测试客户提供的关键词

结果如下:

curl 'poco.ehaoyao.com/api/v1.6/public/recommender/?api_key=&type=CustomList&custom_type=hwg_v1_australia_rmtj&user_id=u1&amount=10' | python -mjson.tool | grep '"item_id'  %

            "item_id": "19955",
            "item_id": "19954",
            "item_id": "1365",
            "item_id": "2011",
            "item_id": "7127",
            "item_id": "13040",
            "item_id": "10339",
            "item_id": "15474",
            "item_id": "16187",
            "item_id": "2455",

客户设置的两个商品,也拍到了最前,剩余用热门商品补充

如果使用未设置的推荐类型,则返回热门商品

curl 'poco.ehaoyao.com/api/v1.6/public/recommender/?api_key=&type=CustomList&custom_type=hwg_v1_australia_rmt&user_id=u1&amount=10' | python -mjson.tool | grep '"item_id'    
            "item_id": "1365",
            "item_id": "2011",
            "item_id": "7127",
            "item_id": "13040",
            "item_id": "10339",
            "item_id": "15474",
            "item_id": "16187",
            "item_id": "2455",
            "item_id": "639",
            "item_id": "17470",