Discovery Recommendations and Visual Search

Discovery recommendation widgets and visual (image) search use the Discovery v2 Pathways API. Content editors configure these features through the user interface; developer involvement is minimal. This page describes the available widget document types, the wizard editors for configuration, and the process to enable image-based search.

ON THIS PAGE

v1 vs. v2 - Automatic Version Selection

The plugin supports two Discovery recommendation APIs and selects between them based on configuration:

  • v1 (discoverySearchAPI): Used when no authKey is configured.
  • v2 Pathways (discoveryPathwaysAPI): Used automatically when authKey is present.

You do not need to set a configuration flag. The presence of authKey—provided via BRXDIS_AUTH_KEY, -Dbrxdis.authKey, the global configuration node, or a per-channel discoveryAuthKeyEnvVar override—determines which API is used. For details, see Configuration.

Visual search is only available with v2. v1 does not support this feature.

Recommendation Document Types

Each recommendation widget is defined as a JCR document. Editors use a dedicated wizard interface to configure these documents, rather than editing raw parameters.

Document typeWizardWidget types targeted
Discovery Product Recommendation3-step product recommendation wizardco_viewed, co_bought, rt_recs, mlt
Discovery Category Recommendation3-step category recommendation wizardcategory
Discovery Global/Personalized Recommendation3-step global recommendation wizardbestseller, trending_product, jfy, past_purchases, recently_viewed
Discovery Keyword Recommendation3-step keyword recommendation wizardkeyword/query-driven widgets

The 3-Step Wizard

Edit Recommendation wizard showing widget selection list

The wizard guides editors through the following steps:

  1. Widget Selection: Choose from the recommendation widgets available in your Discovery account. The list is filtered to show only widget types relevant to the current document type.

  2. Context (product and category widgets only): Select whether the widget is always linked to a specific product or category ("Pinned"), or if it should dynamically use the product/category ID from the current page URL at render time ("Dynamic"). This step is skipped for global and personalized widgets.

    Edit Recommendation context step with specific product picker

  3. Review: Review the configuration summary and see a live thumbnail preview of the widget output.

    Recommendation review screen with product sample preview cards

For widgets in Dynamic mode, editors can enter a sample product or category ID to preview the output. This value is used only for preview and is not saved.

Placing a Recommendation Component

Refer to Component Parameters for the shared parameter table. Each recommendation component references the widget configuration created through the wizard. No additional setup is required for the component itself.

Example: "Similar Items" carousel on a product detail page

To display a "Similar Items" carousel, place both DiscoveryProductDetailComponent and DiscoveryProductRecommendationComponent on the product detail page. Leave both components in Dynamic mode. When a user navigates to a product page with ?pid=SKU-123 in the URL, both components receive the product ID automatically. No extra integration is needed.

Visual search allows shoppers to upload a photo instead of entering keywords, returning products that visually match the image.

Search bar with camera icon and green Search button

Visual search is enabled per channel in Channel Manager under Channel Settings → Visual Search.

FieldTypeDefaultDescription
discoveryVisualSearchEnabledbooleanfalseDisplays the camera button in the search bar and activates the upload endpoint.
discoveryVisualSearchWidgetIdString""The visual search widget ID from your Discovery dashboard. This is required when enabling visual search.

Visual Search settings with enabled checkbox and widget ID field

If visual search is enabled without specifying a widget ID, the plugin logs a warning and defaults to keyword search. Users will not see a broken interface.

No component parameter changes are needed. The same DiscoverySearchInputComponent and DiscoverySearchGridComponent used for keyword search also support visual search automatically.

How Visual Search Works

  1. The shopper selects or takes a photo.
  2. The image is uploaded to a server-side endpoint provided by the plugin. Discovery credentials are not exposed to the browser.
  3. The plugin sends the image to Discovery and receives an image reference ID.
  4. The shopper is redirected to the results page, which detects the image reference and calls Discovery's visual search API.
  5. The results page displays matching products in the standard product grid. Facets and pagination are not available for image-based results, as Discovery does not return them for this query type.

Example visual search results:

Visual search results page listing pet product matches

The plugin manages the integration, including communication with Discovery and mapping responses to usable models. It does not provide a front end. The UI shown in these examples is for reference only. You must implement your own templates or components to display the data returned by the plugin.

Visual Search Mount Placement

The plugin's visual search endpoints must be accessible through an HST mount located under the channel mount that contains the Discovery channel settings. This placement allows the endpoint to resolve the correct per-channel credentials.

/commerce: jcr:primaryType: hst:mount hst:mountpoint: /hst:site/hst:sites/commerce hst:namedpipeline: resourceapi /_brxdis-api: jcr:primaryType: hst:mount hst:ismapped: false hst:types: [rest] hst:namedpipeline: BrxdisVisualSearchPipeline

Do not mount this endpoint at the host root or as a sibling to your channels. If the endpoint is not nested under a channel, it cannot resolve per-channel credentials and will fall back to the global configuration.

Troubleshooting

SymptomLikely Cause
Camera button not visibleVisual search is disabled or no widget ID is set for this channel.
Upload failsThe widget ID in Channel Settings does not match a widget in the Discovery dashboard.
Results page falls back to keyword searchThe image reference from the upload was not passed to the results page during redirect.
authKey missing warning in logsVisual search requires v2 Pathways credentials. See Configuration.
Share Feedback
Page: /build/enterprise-plugins/discovery-plugin/recommendations-and-visual-search
Section: Build
Category *