Fetch Items-for-Item Recommendations (Collaborative/BPR Method)
In Managed Fusion, you can download and import a query pipeline that works out of the box with the default BPR Recommender job.
There are two separate pipelines attached below which work in different ways to query and return recommendations.
-
Rename the file to replace
APPName
with the name of your Managed Fusion app, such asProductCatalog_item_item_rec_pipelines_bpr.json
. -
Open the JSON file, replace all instances of
APPName
with the name of your Managed Fusion app, such asProductCatalog
, and save it. -
Import the JSON file into your Managed Fusion instance using the Query Pipelines REST API:
curl -u USERNAME:PASSWORD <https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/query-pipelines -XPOST -H 'content-type:application/json' -d@<path/to/filename.json>
-
In the Managed Fusion UI, navigate to Query > Query Pipelines to verify that the new pipeline is available.
This pipeline should be used to query the collection where the recommendations are stored. It makes a query against the itemId
field and only returns the recommendeditemId
values. To get the actual items, you need to make a second query to the respective catalog collection with the returneditemId
values.
No additional configuration is needed to use this pipeline with the default BPR job configuration.
-
Rename the file to replace
APPName
with the name of your Managed Fusion app, such asProductCatalog_item_item_rec_pipelines_bpr.json
. -
Open the JSON file, replace all instances of
APPName
with the name of your Managed Fusion app, such asProductCatalog
. -
Fill in the
collection
name field in the firstRecommend Items for Item
stage and save the file. -
Import the JSON file into your Managed Fusion instance using the Query Pipelines REST API:
curl -u USERNAME:PASSWORD https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/query-pipelines -XPOST -H 'content-type:application/json' -d@<path/to/filename.json>
-
In the Managed Fusion UI, navigate to Query > Query Pipelines to verify that the new pipeline is available.
This pipeline queries the recommendations collection and then makes a subsequent query to the actual catalog collection boosting the recommended items and returning the actual items from the catalog. This pipeline will therefore also return recommendations even if none were generated/available. |
This pipeline expects a request parameter called id=<itemId> to be appended to the request in order to work. An example query URL to this pipeline would look like https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/query-pipelines/APPName_items_for_item_bpr_boost/collections/catalog/select?q=:&id=SomeItemId
|
If the pipeline does not appear in the Query Pipelines panel, you may need to attach it to your app like this: Go to System > Object Explorer, click the In No Apps filter, hover over the pipeline, click the icon, and select Add to this app. |
No additional configuration is needed to use this pipeline with the default BPR job configuration.