Skip to content

Commit 82aef87

Browse files
committed
Use new recommendation endpoints
1 parent 89bb148 commit 82aef87

File tree

178 files changed

+252
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+252
-262
lines changed

README.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,15 @@ userIds.forEach((userId) => {
7272
client.send(new rqs.Batch(purchases))
7373
.then(() => {
7474
//Get 5 recommended items for user 'user-25'
75-
client.send(new rqs.UserBasedRecommendation('user-25', 5))
75+
client.send(new rqs.RecommendItemsToUser('user-25', 5))
7676
.then((recommended) => {
77-
console.log(`Recommended items for user-25: ${recommended}`);
77+
console.log("Recommended items for user-25: %j", recommended);
7878
});
7979
})
8080
.catch((error) => {
8181
console.error(error);
8282
// Use fallback
8383
});
84-
8584
```
8685

8786
### Using property values
@@ -152,31 +151,26 @@ client.send(new rqs.Batch([new rqs.ResetDatabase(), //TODO
152151
})
153152
.then((responses) => {
154153
// Get 5 recommendations for user-42, who is currently viewing computer-6
155-
return client.send(new rqs.ItemBasedRecommendation('computer-6', 5,
156-
{'targetUserId': 'user-42'}));
154+
return client.send(new rqs.RecommendItemsToItem('computer-6', 'user-42', 5));
157155
})
158156
.then((recommended) => {
159-
console.log(`Recommended items: ${recommended}`);
160-
161-
// Get 5 recommendations for user-42, but recommend only computers that
162-
// have at least 3 cores
163-
return client.send(new rqs.ItemBasedRecommendation('computer-6', 5,
164-
{'targetUserId': 'user-42',
165-
'filter': "'num-cores'>=3"
166-
}));
157+
console.log("Recommended items: %j", recommended);
158+
159+
// Recommend only computers that have at least 3 cores
160+
return client.send(new rqs.RecommendItemsToItem('computer-6', 'user-42', 5,
161+
{'filter': "'num-cores'>=3"}
162+
));
167163
})
168164
.then((recommended) => {
169-
console.log(`Recommended items with at least 3 processor cores: ${recommended}`);
170-
171-
// Get 5 recommendations for user-42, but recommend only items that
172-
// are more expensive then currently viewed item (up-sell)
173-
return client.send(new rqs.ItemBasedRecommendation('computer-6', 5,
174-
{'targetUserId': 'user-42',
175-
'filter': "'num-cores'>=3"
176-
}));
165+
console.log("Recommended items with at least 3 processor cores: %j", recommended);
166+
167+
// Recommend only items that are more expensive then currently viewed item (up-sell)
168+
return client.send(new rqs.RecommendItemsToItem('computer-6', 'user-42', 5,
169+
{'filter': "'num-cores'>=3"}
170+
));
177171
})
178172
.then((recommended) => {
179-
console.log(`Recommended up-sell items: ${recommended}`)
173+
console.log("Recommended up-sell items: %j", recommended)
180174
})
181175
.catch((error) => {
182176
console.error(error);

doc/AddBookmark.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
485485
<br class="clear">
486486

487487
<footer>
488-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
488+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
489489
</footer>
490490

491491
<script> prettyPrint(); </script>

doc/AddCartAddition.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
491491
<br class="clear">
492492

493493
<footer>
494-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
494+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
495495
</footer>
496496

497497
<script> prettyPrint(); </script>

doc/AddDetailView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
488488
<br class="clear">
489489

490490
<footer>
491-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
491+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
492492
</footer>
493493

494494
<script> prettyPrint(); </script>

doc/AddGroup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
432432
<br class="clear">
433433

434434
<footer>
435-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
435+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
436436
</footer>
437437

438438
<script> prettyPrint(); </script>

doc/AddItem.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
433433
<br class="clear">
434434

435435
<footer>
436-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
436+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
437437
</footer>
438438

439439
<script> prettyPrint(); </script>

doc/AddItemProperty.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
455455
<br class="clear">
456456

457457
<footer>
458-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
458+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
459459
</footer>
460460

461461
<script> prettyPrint(); </script>

doc/AddPurchase.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
494494
<br class="clear">
495495

496496
<footer>
497-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
497+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
498498
</footer>
499499

500500
<script> prettyPrint(); </script>

doc/AddRating.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
508508
<br class="clear">
509509

510510
<footer>
511-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
511+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
512512
</footer>
513513

514514
<script> prettyPrint(); </script>

doc/AddSeries.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AddBookma
432432
<br class="clear">
433433

434434
<footer>
435-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Thu Oct 26 2017 17:52:55 GMT+0200 (CEST)
435+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 19 2018 17:28:03 GMT+0100 (CET)
436436
</footer>
437437

438438
<script> prettyPrint(); </script>

0 commit comments

Comments
 (0)