grahamjenson / hapiger

HapiGer is an http-wrapper around the Good Enough Recommendation engine using the Hapi.js framework
174 stars 36 forks source link

recommendations not update #8

Open arafay696 opened 8 years ago

arafay696 commented 8 years ago

Hi, First, i want to thanks to you for great plugin.Its really a good plugin and informative. Problem: Events:

curl -X POST 'http://localhost:3456/events' -d '{
    "events": [
    {
      "namespace":  "test",
      "person":     "a@gmail.coom",
      "action":     "view",
      "thing":      "IPOD"
    }
  ]
}'
curl -X POST 'http://localhost:3456/events' -d '{
    "events": [
    {
      "namespace":  "test",
      "person":     "b@gmail.com",
      "action":     "view",
      "thing":      "IPOD"
    }
  ]
}'
curl -X POST 'http://localhost:3456/events' -d '{
    "events": [
    {
      "namespace":  "test",
      "person":     "b@gmail.com",
      "action":     "buy",
      "thing":      "IPOD",
      "expires_at": "2016-09-10"
    }
  ]
}'`

recommendations:

`curl -X POST 'http://localhost:3456/recommendations' -d '{
    "namespace": "test",
    "person": "a@gmail.coom",
    "configuration": {
      "actions" : {"view": 5, "buy": 10}
    }
}'

returns: IPOD

But when i raise event for 'a@gmail.com'

curl -X POST 'http://localhost:3456/events' -d '{
    "events": [
    {
      "namespace":  "test",
      "person":     "a@gmail.coom",
      "action":     "buy",
      "thing":      "IPOD",
      "expires_at": "2016-09-10"
    }
  ]
}'

and send request for recommendation it still returns "IPOD". Why? What should i do?

2: hapiger using postgres works in windows or not?

grahamjenson commented 8 years ago

1: There are many events that if they happen you still want to be able to recommend their thing, e.g. if a user views and ipod, you would still like them to be recommended to buy the ipod. If someone does buy the ipod and you do not want them to be recommended anymore, then you can use filter_previous_actions as specified in the docs here https://github.com/grahamjenson/ger 2: Node works in windows, postgres works in windows, I assume that HapiGER works in windows... but I have not tested it.