-
Notifications
You must be signed in to change notification settings - Fork 5
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
5046: Use recommendation service instead of crafted search #143
base: master
Are you sure you want to change the base?
Conversation
63498b5
to
0c04428
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall 👍
* @param {string} The name of the search index to query. | ||
* @param {string[]} The values to query for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSDoc misses the name of the parameter.
* @param {string} The name of the search index to query. | |
* @param {string[]} The values to query for. | |
* @param {string} index The name of the search index to query. | |
* @param {string[]} values The values to query for. |
// Get the current slice of recommendations. This causes repeated | ||
// calls to the recommendation service, but it's the simplest way to | ||
// implement it in the current code. Leave optimization for later. | ||
const relatedFausts = (await relatedClient.getRecommendations({ id })).slice( | ||
offset, | ||
limit, | ||
fields, | ||
sort | ||
}); | ||
offset + limit | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess offset and limit will be parameters on the recommendation service over time. Would it make sense to move the slice logic into the client, and just pass them as params.
const relatedFausts = await relatedClient.getRecommendations({ id, offset, limit });
/** | ||
* Creates an instance of LibryRecommendationService. | ||
* | ||
* @param {object} options | ||
* @param {string} options.baseUrl | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClientId is missing in doc
/** | |
* Creates an instance of LibryRecommendationService. | |
* | |
* @param {object} options | |
* @param {string} options.baseUrl | |
*/ | |
/** | |
* Creates an instance of LibryRecommendationService. | |
* | |
* @param {object} options | |
* @param {string} options.baseUrl | |
* @param {string} options.clientId | |
*/ |
The search link has been removed as it doesn't make any sense anymore, as we can't make the search return the same materials in the same order.