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

5046: Use recommendation service instead of crafted search #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xendk
Copy link
Contributor

@xendk xendk commented Aug 17, 2021

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.

@xendk xendk force-pushed the 5046-use-papps branch 3 times, most recently from 63498b5 to 0c04428 Compare August 17, 2021 09:46
Copy link

@vibjerg vibjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall 👍

Comment on lines +16 to +17
* @param {string} The name of the search index to query.
* @param {string[]} The values to query for.
Copy link

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.

Suggested change
* @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.

Comment on lines +68 to +74
// 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
);
Copy link

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 });

Comment on lines +10 to +15
/**
* Creates an instance of LibryRecommendationService.
*
* @param {object} options
* @param {string} options.baseUrl
*/
Copy link

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

Suggested change
/**
* 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
*/

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

Successfully merging this pull request may close these issues.

2 participants