@chelseaapps/recommender documentation

File

Index

Constructor

constructor(options: RecommenderOptions, cacheManager: Cache)

Parameters :

Methods

Async addDetailView

addDetailView(userID: stringarrow-up-right, itemID: stringarrow-up-right, recommendationID: stringarrow-up-right)

Register a detail view by a user on an item

Parameters :

Returns : {}

Response

Async addRating

addRating(userID: stringarrow-up-right, itemID: stringarrow-up-right, rating: numberarrow-up-right, recommendationID: stringarrow-up-right)

Adds a rating of given item made by a given user.

Parameters :

Returns : {}

Async deleteItem

deleteItem(itemID: stringarrow-up-right)

Delete an item

Parameters :

Returns : {}

Response

Private Async get

Type parameters :

  • T

Get an object from the cache by a given key

Parameters :

Returns : {}

Object cast to T

Async recommendItemsToItem

recommendItemsToItem(itemID: stringarrow-up-right, userID: string | null, count: numberarrow-up-right)

Recommends set of items that are somehow related to one given item, X. Typical scenario is when user A is viewing X. Then you may display items to the user that he might be also interested in. Recommend items to item request gives you Top-N such items, optionally taking the target user A into account. The returned items are sorted by relevance (first item being the most relevant). Besides the recommended items, also a unique recommId is returned in the response. It can be used to:

  • Let Recombee know that this recommendation was successful (e.g. user clicked one of the recommended items). See Reported metricsarrow-up-right.

  • Get subsequent recommended items when the user scrolls down (infinite scroll) or goes to the next page. See Recommend Next Itemsarrow-up-right. It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters.

Parameters :

Returns : Promise<IRecommendationsResult>

Async recommendItemsToUser

recommendItemsToUser(userID: stringarrow-up-right, count: numberarrow-up-right)

Returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (infinite scroll) or goes to a next page. It accepts recommId of a base recommendation request (e.g. request from the first page) and number of items that shall be returned (count). The base request can be one of:

  • Search itemsarrow-up-right All the other parameters are inherited from the base request. Recommend next items can be called many times for a single recommId and each call returns different (previously not recommended) items. The number of Recommend next items calls performed so far is returned in the numberNextRecommsCalls field. Recommend next items can be requested up to 30 minutes after the base request or a previous Recommend next items call. For billing purposes, each call to Recommend next items is counted as a separate recommendation request.

Parameters :

Returns : Promise<IRecommendationsResult>

Async recommendNextItems

recommendNextItems(recommendationID: stringarrow-up-right, count: numberarrow-up-right)

Returns items that shall be shown to a user as next recommendations when the user e.g. scrolls the page down (infinite scroll) or goes to a next page.

Parameters :

Returns : {}

Async recommendUsersToUser

recommendUsersToUser(userID: stringarrow-up-right, count: numberarrow-up-right)

Get similar users as some given user, based on the user's past interactions (purchases, ratings, etc.) and values of properties. It is also possible to use POST HTTP method (for example in case of very long ReQL filter) - query parameters then become body parameters. The returned users are sorted by similarity (first user being the most similar).

Parameters :

Returns : {}

Async searchItems

searchItems(userID: stringarrow-up-right, query: stringarrow-up-right, count: numberarrow-up-right)

Full-text personalized search. The results are based on the provided searchQuery and also on the user's past interactions (purchases, ratings, etc.) with the items (items more suitable for the user are preferred in the results).

Parameters :

Returns : Promise<IRecommendationsResult>

Private Async send

send(request: requests.Request)

Send a request. Catches default errors (401 & 405)

Parameters :

Returns : {}

Result from request

Private Async set

Store an object in the cache for the default amount of time

Parameters :

Returns : anyarrow-up-right

Async setItem

setItem(itemID: stringarrow-up-right, details: T)

Type parameters :

  • T

Set an item's properties, or create if doesn't exist

Parameters :

Returns : {}

Response

Async setUser

setUser(userID: stringarrow-up-right, details: T)

Type parameters :

  • T

Add a user to the recommendation engine

Parameters :

Returns : {}

Response

Properties

Was this helpful?