Skip to content

docs(recommend): add TSDoc #1305

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

Merged
merged 1 commit into from
Sep 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/recommend/src/types/RecommendationsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,40 @@ import { RecommendModel } from './RecommendModel';
import { RecommendSearchOptions } from './RecommendSearchOptions';

export type RecommendationsQuery = {
/**
* The name of the target index.
*/
readonly indexName: string;

/**
* The name of the Recommendation model to use.
*/
readonly model: RecommendModel;

/**
* The `objectID` of the item to get recommendations for.
*/
readonly objectID: string;

/**
* Threshold for the recommendations confidence score (between 0 and 100). Only recommendations with a greater score are returned.
*/
readonly threshold?: number;

/**
* How many recommendations to retrieve.
*/
readonly maxRecommendations?: number;

/**
* List of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) to send.
*/
readonly queryParameters?: RecommendSearchOptions;

/**
* List of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/) to send.
*
* Additional filters to use as fallback when there aren’t enough recommendations.
*/
readonly fallbackParameters?: RecommendSearchOptions;
};