Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

like dislike not working, recommendationFor returns empty array. #40

Closed
nicholas-ooi opened this issue Mar 6, 2016 · 4 comments
Closed

Comments

@nicholas-ooi
Copy link

as title mentioned.

@gabriel-alecu
Copy link

Yeah. liked() and disliked() seem to require a callback, even if some examples don't have one...

Examples from the page (throw error about callback no being a function in the current version):
raccoon.liked('garyId', 'movieId');
raccoon.liked('garyId', 'movie2Id');
raccoon.liked('chrisId', 'movieId');

They work like this instead:
raccoon.liked('garyId', 'movieId', function() {});
raccoon.liked('garyId', 'movie2Id', function() {});
raccoon.liked('chrisId', 'movieId', function() {});

recommendFor() seems to work, but it might not work right after liked() and disliked() due to their asynchronous nature. You could use the callbacks to chain them one after another.

@brendonboshell
Copy link

brendonboshell commented Oct 15, 2016

It appears the recommendation set is only updated on a call to liked(). This is a problem when importing data because the first few users will have no recommendations (and early users will have incorrect recommendations). I have resolved this by calling liked() again (after the entire import) before calling recommendFor.

@guymorita
Copy link
Owner

guymorita commented Dec 30, 2016

@brendonboshell Yep, that is problem. I'm going to add an options parameter into liked / disliked so that you can import data quicker by not updating recommendations. And then a separate method to fire the update sequence.

@guymorita
Copy link
Owner

@nicholas-ooi Updated the readme to account for the async nature of the calls. Also it supports ES6 promises now :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants