Documentation Center

Recommendation sample: adding a concept not used by the item

If the item identified by id uses concepts from a scheme, you can supply your own concept from the same scheme to change the recommendation behavior.

search(
  recommend: {
    id: "tcm:5-449"
    concepts: [
      {
        connectorId:"glassware"
        boostBy: 1
        broadenBy: 1   
        conceptIds:["e-learning-poolparty-biz_cocktails_2dce3576-2603-41f9-8dce-ab21f639c2a7"]
      },
      {
        connectorId:"ingredients"
        boostBy: 10                              
      }
    ]
  }
)

The above sample query replaces a concept of the item itself (in this case, a concept of its glassware scheme, say coffee cup) and instead supplies a concept of its own in the conceptIds array, in this case, the concept coffee mug with identifier e-learning-poolparty-biz_cocktails_2dce3576-2603-41f9-8dce-ab21f639c2a7. The broadenBy: 1 line ensures that the parent concept of coffee mug, which is hot drinks, is also accepted as a concept for recommendations. Combined with the boosted ingredients scheme, the resulting recommendations consist of beverages whose ingredients match those of the item itself, but which are served in a coffee mug, or more generally are hot drinks.

Note that the added concept (coffee mug in this case) must belong to a scheme (glassware) that contains other concepts that the item itself uses (coffee cup). If you reference a scheme that the item itself doesn't use at all, then that item in the concepts array will simply be ignored.