API

Insert

Insert New Items

curl -X PUT -H 'Content-Type: application/json' 127.0.0.1:8080/items -d '[2048,2049,2050]'

Insert three new items [2048,2049,2050].

{
    "Failed": false,
    "BeforeCount": 1687,
    "AfterCount": 1690
}

Insert New Feedbacks

curl -X PUT -H 'Content-Type: application/json' 127.0.0.1:8080/ratings \
    -d '[{"UserId":2048,"ItemId":1000,"Rating":3},{"UserId":2049,"ItemId":1000,"Rating":3},{"UserId":2050,"ItemId":1000,"Rating":3}]'

Insert three new ratings: <2048,1000,3>, <2049,1000,3> and <2050,1000,3>.

{
    "Failed": false,
    "BeforeCount": 100000,
    "AfterCount": 100003
}

Query

Get Random Items

curl 127.0.0.1:8080/random?number=10

Get 10 random items.

{
    "Failed": false,
    "Items": [454, 1584, 1124, 1165, 1617, 945, 1268, 610, 783, 1091]
}

Get Similar Items

curl 127.0.0.1:8080/neighbors/100/?number=10

Get top 10 similar items for the 100th item.

{
    "Failed": false,
    "Items": [247, 897, 442, 643, 757, 788, 838, 957, 907, 891]
}