Skip to content

Commit

Permalink
Support RecommendNextItems endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraFiedler committed Jan 14, 2021
1 parent f8fe7cc commit 24339a3
Show file tree
Hide file tree
Showing 240 changed files with 2,145 additions and 880 deletions.
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,23 @@ userIds.forEach((userId) => {

// Send the data to Recombee, use Batch for faster processing of larger data
client.send(new rqs.Batch(purchases))
.then(() => {
//Get 5 recommended items for user 'user-25'
client.send(new rqs.RecommendItemsToUser('user-25', 5))
.then((recommended) => {
console.log("Recommended items for user-25: %j", recommended);
});
})
.catch((error) => {
console.error(error);
// Use fallback
});
.then(() => {
//Get 5 recommended items for user 'user-25'
return client.send(new rqs.RecommendItemsToUser('user-25', 5));
})
.then((response) => {
console.log("Recommended items for user-25: %j", response.recomms);

// User scrolled down - get next 3 recommended items
return client.send(new rqs.RecommendNextItems(response.recommId, 3));
})
.then((response) => {
console.log("Next recommended items for user-25: %j", response.recomms);
})
.catch((error) => {
console.error(error);
// Use fallback
});
```

### Using property values
Expand Down Expand Up @@ -180,7 +186,7 @@ client.send(new rqs.Batch([
})
.then((recommended) => {
// Perform personalized full-text search with a user's search query (e.g. "computers")
return client.send(new rqs.SearchItems('user-42', 'computers', 5));
return client.send(new rqs.SearchItems('user-42', 'computers', 5, {'scenario': "search_top"}));
})
.then((matched) => {
console.log("Matched items: %j", matched)
Expand Down
10 changes: 8 additions & 2 deletions doc/AddBookmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ <h5>Parameters:</h5>






</div>

Expand Down Expand Up @@ -334,6 +336,8 @@ <h4 class="name" id="bodyParameters"><span class="type-signature"></span>bodyPar





<h5>Returns:</h5>


Expand Down Expand Up @@ -442,6 +446,8 @@ <h4 class="name" id="queryParameters"><span class="type-signature"></span>queryP





<h5>Returns:</h5>


Expand Down Expand Up @@ -485,13 +491,13 @@ <h5>Returns:</h5>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookmark.html">AddBookmark</a></li><li><a href="AddCartAddition.html">AddCartAddition</a></li><li><a href="AddDetailView.html">AddDetailView</a></li><li><a href="AddGroup.html">AddGroup</a></li><li><a href="AddItem.html">AddItem</a></li><li><a href="AddItemProperty.html">AddItemProperty</a></li><li><a href="AddPurchase.html">AddPurchase</a></li><li><a href="AddRating.html">AddRating</a></li><li><a href="AddSeries.html">AddSeries</a></li><li><a href="AddUser.html">AddUser</a></li><li><a href="AddUserProperty.html">AddUserProperty</a></li><li><a href="ApiClient.html">ApiClient</a></li><li><a href="ApiError.html">ApiError</a></li><li><a href="Batch.html">Batch</a></li><li><a href="DeleteBookmark.html">DeleteBookmark</a></li><li><a href="DeleteCartAddition.html">DeleteCartAddition</a></li><li><a href="DeleteDetailView.html">DeleteDetailView</a></li><li><a href="DeleteGroup.html">DeleteGroup</a></li><li><a href="DeleteItem.html">DeleteItem</a></li><li><a href="DeleteItemProperty.html">DeleteItemProperty</a></li><li><a href="DeletePurchase.html">DeletePurchase</a></li><li><a href="DeleteRating.html">DeleteRating</a></li><li><a href="DeleteSeries.html">DeleteSeries</a></li><li><a href="DeleteUser.html">DeleteUser</a></li><li><a href="DeleteUserProperty.html">DeleteUserProperty</a></li><li><a href="DeleteViewPortion.html">DeleteViewPortion</a></li><li><a href="GetItemPropertyInfo.html">GetItemPropertyInfo</a></li><li><a href="GetItemValues.html">GetItemValues</a></li><li><a href="GetUserPropertyInfo.html">GetUserPropertyInfo</a></li><li><a href="GetUserValues.html">GetUserValues</a></li><li><a href="InsertToGroup.html">InsertToGroup</a></li><li><a href="InsertToSeries.html">InsertToSeries</a></li><li><a href="ItemBasedRecommendation.html">ItemBasedRecommendation</a></li><li><a href="ListGroupItems.html">ListGroupItems</a></li><li><a href="ListGroups.html">ListGroups</a></li><li><a href="ListItemBookmarks.html">ListItemBookmarks</a></li><li><a href="ListItemCartAdditions.html">ListItemCartAdditions</a></li><li><a href="ListItemDetailViews.html">ListItemDetailViews</a></li><li><a href="ListItemProperties.html">ListItemProperties</a></li><li><a href="ListItemPurchases.html">ListItemPurchases</a></li><li><a href="ListItemRatings.html">ListItemRatings</a></li><li><a href="ListItems.html">ListItems</a></li><li><a href="ListItemViewPortions.html">ListItemViewPortions</a></li><li><a href="ListSeries.html">ListSeries</a></li><li><a href="ListSeriesItems.html">ListSeriesItems</a></li><li><a href="ListUserBookmarks.html">ListUserBookmarks</a></li><li><a href="ListUserCartAdditions.html">ListUserCartAdditions</a></li><li><a href="ListUserDetailViews.html">ListUserDetailViews</a></li><li><a href="ListUserProperties.html">ListUserProperties</a></li><li><a href="ListUserPurchases.html">ListUserPurchases</a></li><li><a href="ListUserRatings.html">ListUserRatings</a></li><li><a href="ListUsers.html">ListUsers</a></li><li><a href="ListUserViewPortions.html">ListUserViewPortions</a></li><li><a href="MergeUsers.html">MergeUsers</a></li><li><a href="RecommendItemsToItem.html">RecommendItemsToItem</a></li><li><a href="RecommendItemsToUser.html">RecommendItemsToUser</a></li><li><a href="RecommendUsersToItem.html">RecommendUsersToItem</a></li><li><a href="RecommendUsersToUser.html">RecommendUsersToUser</a></li><li><a href="RemoveFromGroup.html">RemoveFromGroup</a></li><li><a href="RemoveFromSeries.html">RemoveFromSeries</a></li><li><a href="Request.html">Request</a></li><li><a href="ResetDatabase.html">ResetDatabase</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="SearchItems.html">SearchItems</a></li><li><a href="SetItemValues.html">SetItemValues</a></li><li><a href="SetUserValues.html">SetUserValues</a></li><li><a href="SetValues.html">SetValues</a></li><li><a href="SetViewPortion.html">SetViewPortion</a></li><li><a href="TimeoutError.html">TimeoutError</a></li><li><a href="UserBasedRecommendation.html">UserBasedRecommendation</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookmark.html">AddBookmark</a></li><li><a href="AddCartAddition.html">AddCartAddition</a></li><li><a href="AddDetailView.html">AddDetailView</a></li><li><a href="AddGroup.html">AddGroup</a></li><li><a href="AddItem.html">AddItem</a></li><li><a href="AddItemProperty.html">AddItemProperty</a></li><li><a href="AddPurchase.html">AddPurchase</a></li><li><a href="AddRating.html">AddRating</a></li><li><a href="AddSeries.html">AddSeries</a></li><li><a href="AddUser.html">AddUser</a></li><li><a href="AddUserProperty.html">AddUserProperty</a></li><li><a href="ApiClient.html">ApiClient</a></li><li><a href="ApiError.html">ApiError</a></li><li><a href="Batch.html">Batch</a></li><li><a href="DeleteBookmark.html">DeleteBookmark</a></li><li><a href="DeleteCartAddition.html">DeleteCartAddition</a></li><li><a href="DeleteDetailView.html">DeleteDetailView</a></li><li><a href="DeleteGroup.html">DeleteGroup</a></li><li><a href="DeleteItem.html">DeleteItem</a></li><li><a href="DeleteItemProperty.html">DeleteItemProperty</a></li><li><a href="DeletePurchase.html">DeletePurchase</a></li><li><a href="DeleteRating.html">DeleteRating</a></li><li><a href="DeleteSeries.html">DeleteSeries</a></li><li><a href="DeleteUser.html">DeleteUser</a></li><li><a href="DeleteUserProperty.html">DeleteUserProperty</a></li><li><a href="DeleteViewPortion.html">DeleteViewPortion</a></li><li><a href="GetItemPropertyInfo.html">GetItemPropertyInfo</a></li><li><a href="GetItemValues.html">GetItemValues</a></li><li><a href="GetUserPropertyInfo.html">GetUserPropertyInfo</a></li><li><a href="GetUserValues.html">GetUserValues</a></li><li><a href="InsertToGroup.html">InsertToGroup</a></li><li><a href="InsertToSeries.html">InsertToSeries</a></li><li><a href="ItemBasedRecommendation.html">ItemBasedRecommendation</a></li><li><a href="ListGroupItems.html">ListGroupItems</a></li><li><a href="ListGroups.html">ListGroups</a></li><li><a href="ListItemBookmarks.html">ListItemBookmarks</a></li><li><a href="ListItemCartAdditions.html">ListItemCartAdditions</a></li><li><a href="ListItemDetailViews.html">ListItemDetailViews</a></li><li><a href="ListItemProperties.html">ListItemProperties</a></li><li><a href="ListItemPurchases.html">ListItemPurchases</a></li><li><a href="ListItemRatings.html">ListItemRatings</a></li><li><a href="ListItems.html">ListItems</a></li><li><a href="ListItemViewPortions.html">ListItemViewPortions</a></li><li><a href="ListSeries.html">ListSeries</a></li><li><a href="ListSeriesItems.html">ListSeriesItems</a></li><li><a href="ListUserBookmarks.html">ListUserBookmarks</a></li><li><a href="ListUserCartAdditions.html">ListUserCartAdditions</a></li><li><a href="ListUserDetailViews.html">ListUserDetailViews</a></li><li><a href="ListUserProperties.html">ListUserProperties</a></li><li><a href="ListUserPurchases.html">ListUserPurchases</a></li><li><a href="ListUserRatings.html">ListUserRatings</a></li><li><a href="ListUsers.html">ListUsers</a></li><li><a href="ListUserViewPortions.html">ListUserViewPortions</a></li><li><a href="MergeUsers.html">MergeUsers</a></li><li><a href="RecommendItemsToItem.html">RecommendItemsToItem</a></li><li><a href="RecommendItemsToUser.html">RecommendItemsToUser</a></li><li><a href="RecommendNextItems.html">RecommendNextItems</a></li><li><a href="RecommendUsersToItem.html">RecommendUsersToItem</a></li><li><a href="RecommendUsersToUser.html">RecommendUsersToUser</a></li><li><a href="RemoveFromGroup.html">RemoveFromGroup</a></li><li><a href="RemoveFromSeries.html">RemoveFromSeries</a></li><li><a href="Request.html">Request</a></li><li><a href="ResetDatabase.html">ResetDatabase</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="SearchItems.html">SearchItems</a></li><li><a href="SetItemValues.html">SetItemValues</a></li><li><a href="SetUserValues.html">SetUserValues</a></li><li><a href="SetValues.html">SetValues</a></li><li><a href="SetViewPortion.html">SetViewPortion</a></li><li><a href="TimeoutError.html">TimeoutError</a></li><li><a href="UserBasedRecommendation.html">UserBasedRecommendation</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jan 29 2020 13:19:45 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 14 2021 17:29:06 GMT+0100 (Central European Standard Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
10 changes: 8 additions & 2 deletions doc/AddCartAddition.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ <h5>Parameters:</h5>






</div>

Expand Down Expand Up @@ -340,6 +342,8 @@ <h4 class="name" id="bodyParameters"><span class="type-signature"></span>bodyPar





<h5>Returns:</h5>


Expand Down Expand Up @@ -448,6 +452,8 @@ <h4 class="name" id="queryParameters"><span class="type-signature"></span>queryP





<h5>Returns:</h5>


Expand Down Expand Up @@ -491,13 +497,13 @@ <h5>Returns:</h5>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookmark.html">AddBookmark</a></li><li><a href="AddCartAddition.html">AddCartAddition</a></li><li><a href="AddDetailView.html">AddDetailView</a></li><li><a href="AddGroup.html">AddGroup</a></li><li><a href="AddItem.html">AddItem</a></li><li><a href="AddItemProperty.html">AddItemProperty</a></li><li><a href="AddPurchase.html">AddPurchase</a></li><li><a href="AddRating.html">AddRating</a></li><li><a href="AddSeries.html">AddSeries</a></li><li><a href="AddUser.html">AddUser</a></li><li><a href="AddUserProperty.html">AddUserProperty</a></li><li><a href="ApiClient.html">ApiClient</a></li><li><a href="ApiError.html">ApiError</a></li><li><a href="Batch.html">Batch</a></li><li><a href="DeleteBookmark.html">DeleteBookmark</a></li><li><a href="DeleteCartAddition.html">DeleteCartAddition</a></li><li><a href="DeleteDetailView.html">DeleteDetailView</a></li><li><a href="DeleteGroup.html">DeleteGroup</a></li><li><a href="DeleteItem.html">DeleteItem</a></li><li><a href="DeleteItemProperty.html">DeleteItemProperty</a></li><li><a href="DeletePurchase.html">DeletePurchase</a></li><li><a href="DeleteRating.html">DeleteRating</a></li><li><a href="DeleteSeries.html">DeleteSeries</a></li><li><a href="DeleteUser.html">DeleteUser</a></li><li><a href="DeleteUserProperty.html">DeleteUserProperty</a></li><li><a href="DeleteViewPortion.html">DeleteViewPortion</a></li><li><a href="GetItemPropertyInfo.html">GetItemPropertyInfo</a></li><li><a href="GetItemValues.html">GetItemValues</a></li><li><a href="GetUserPropertyInfo.html">GetUserPropertyInfo</a></li><li><a href="GetUserValues.html">GetUserValues</a></li><li><a href="InsertToGroup.html">InsertToGroup</a></li><li><a href="InsertToSeries.html">InsertToSeries</a></li><li><a href="ItemBasedRecommendation.html">ItemBasedRecommendation</a></li><li><a href="ListGroupItems.html">ListGroupItems</a></li><li><a href="ListGroups.html">ListGroups</a></li><li><a href="ListItemBookmarks.html">ListItemBookmarks</a></li><li><a href="ListItemCartAdditions.html">ListItemCartAdditions</a></li><li><a href="ListItemDetailViews.html">ListItemDetailViews</a></li><li><a href="ListItemProperties.html">ListItemProperties</a></li><li><a href="ListItemPurchases.html">ListItemPurchases</a></li><li><a href="ListItemRatings.html">ListItemRatings</a></li><li><a href="ListItems.html">ListItems</a></li><li><a href="ListItemViewPortions.html">ListItemViewPortions</a></li><li><a href="ListSeries.html">ListSeries</a></li><li><a href="ListSeriesItems.html">ListSeriesItems</a></li><li><a href="ListUserBookmarks.html">ListUserBookmarks</a></li><li><a href="ListUserCartAdditions.html">ListUserCartAdditions</a></li><li><a href="ListUserDetailViews.html">ListUserDetailViews</a></li><li><a href="ListUserProperties.html">ListUserProperties</a></li><li><a href="ListUserPurchases.html">ListUserPurchases</a></li><li><a href="ListUserRatings.html">ListUserRatings</a></li><li><a href="ListUsers.html">ListUsers</a></li><li><a href="ListUserViewPortions.html">ListUserViewPortions</a></li><li><a href="MergeUsers.html">MergeUsers</a></li><li><a href="RecommendItemsToItem.html">RecommendItemsToItem</a></li><li><a href="RecommendItemsToUser.html">RecommendItemsToUser</a></li><li><a href="RecommendUsersToItem.html">RecommendUsersToItem</a></li><li><a href="RecommendUsersToUser.html">RecommendUsersToUser</a></li><li><a href="RemoveFromGroup.html">RemoveFromGroup</a></li><li><a href="RemoveFromSeries.html">RemoveFromSeries</a></li><li><a href="Request.html">Request</a></li><li><a href="ResetDatabase.html">ResetDatabase</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="SearchItems.html">SearchItems</a></li><li><a href="SetItemValues.html">SetItemValues</a></li><li><a href="SetUserValues.html">SetUserValues</a></li><li><a href="SetValues.html">SetValues</a></li><li><a href="SetViewPortion.html">SetViewPortion</a></li><li><a href="TimeoutError.html">TimeoutError</a></li><li><a href="UserBasedRecommendation.html">UserBasedRecommendation</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookmark.html">AddBookmark</a></li><li><a href="AddCartAddition.html">AddCartAddition</a></li><li><a href="AddDetailView.html">AddDetailView</a></li><li><a href="AddGroup.html">AddGroup</a></li><li><a href="AddItem.html">AddItem</a></li><li><a href="AddItemProperty.html">AddItemProperty</a></li><li><a href="AddPurchase.html">AddPurchase</a></li><li><a href="AddRating.html">AddRating</a></li><li><a href="AddSeries.html">AddSeries</a></li><li><a href="AddUser.html">AddUser</a></li><li><a href="AddUserProperty.html">AddUserProperty</a></li><li><a href="ApiClient.html">ApiClient</a></li><li><a href="ApiError.html">ApiError</a></li><li><a href="Batch.html">Batch</a></li><li><a href="DeleteBookmark.html">DeleteBookmark</a></li><li><a href="DeleteCartAddition.html">DeleteCartAddition</a></li><li><a href="DeleteDetailView.html">DeleteDetailView</a></li><li><a href="DeleteGroup.html">DeleteGroup</a></li><li><a href="DeleteItem.html">DeleteItem</a></li><li><a href="DeleteItemProperty.html">DeleteItemProperty</a></li><li><a href="DeletePurchase.html">DeletePurchase</a></li><li><a href="DeleteRating.html">DeleteRating</a></li><li><a href="DeleteSeries.html">DeleteSeries</a></li><li><a href="DeleteUser.html">DeleteUser</a></li><li><a href="DeleteUserProperty.html">DeleteUserProperty</a></li><li><a href="DeleteViewPortion.html">DeleteViewPortion</a></li><li><a href="GetItemPropertyInfo.html">GetItemPropertyInfo</a></li><li><a href="GetItemValues.html">GetItemValues</a></li><li><a href="GetUserPropertyInfo.html">GetUserPropertyInfo</a></li><li><a href="GetUserValues.html">GetUserValues</a></li><li><a href="InsertToGroup.html">InsertToGroup</a></li><li><a href="InsertToSeries.html">InsertToSeries</a></li><li><a href="ItemBasedRecommendation.html">ItemBasedRecommendation</a></li><li><a href="ListGroupItems.html">ListGroupItems</a></li><li><a href="ListGroups.html">ListGroups</a></li><li><a href="ListItemBookmarks.html">ListItemBookmarks</a></li><li><a href="ListItemCartAdditions.html">ListItemCartAdditions</a></li><li><a href="ListItemDetailViews.html">ListItemDetailViews</a></li><li><a href="ListItemProperties.html">ListItemProperties</a></li><li><a href="ListItemPurchases.html">ListItemPurchases</a></li><li><a href="ListItemRatings.html">ListItemRatings</a></li><li><a href="ListItems.html">ListItems</a></li><li><a href="ListItemViewPortions.html">ListItemViewPortions</a></li><li><a href="ListSeries.html">ListSeries</a></li><li><a href="ListSeriesItems.html">ListSeriesItems</a></li><li><a href="ListUserBookmarks.html">ListUserBookmarks</a></li><li><a href="ListUserCartAdditions.html">ListUserCartAdditions</a></li><li><a href="ListUserDetailViews.html">ListUserDetailViews</a></li><li><a href="ListUserProperties.html">ListUserProperties</a></li><li><a href="ListUserPurchases.html">ListUserPurchases</a></li><li><a href="ListUserRatings.html">ListUserRatings</a></li><li><a href="ListUsers.html">ListUsers</a></li><li><a href="ListUserViewPortions.html">ListUserViewPortions</a></li><li><a href="MergeUsers.html">MergeUsers</a></li><li><a href="RecommendItemsToItem.html">RecommendItemsToItem</a></li><li><a href="RecommendItemsToUser.html">RecommendItemsToUser</a></li><li><a href="RecommendNextItems.html">RecommendNextItems</a></li><li><a href="RecommendUsersToItem.html">RecommendUsersToItem</a></li><li><a href="RecommendUsersToUser.html">RecommendUsersToUser</a></li><li><a href="RemoveFromGroup.html">RemoveFromGroup</a></li><li><a href="RemoveFromSeries.html">RemoveFromSeries</a></li><li><a href="Request.html">Request</a></li><li><a href="ResetDatabase.html">ResetDatabase</a></li><li><a href="ResponseError.html">ResponseError</a></li><li><a href="SearchItems.html">SearchItems</a></li><li><a href="SetItemValues.html">SetItemValues</a></li><li><a href="SetUserValues.html">SetUserValues</a></li><li><a href="SetValues.html">SetValues</a></li><li><a href="SetViewPortion.html">SetViewPortion</a></li><li><a href="TimeoutError.html">TimeoutError</a></li><li><a href="UserBasedRecommendation.html">UserBasedRecommendation</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jan 29 2020 13:19:45 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Jan 14 2021 17:29:06 GMT+0100 (Central European Standard Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Loading

0 comments on commit 24339a3

Please sign in to comment.