Single-source multi-market for SAP Commerce Cloud

This article explains how to configure the Coveo SAP Commerce extensions in single-source multi-market mode, which powers multiple markets (languages, currencies, or countries) from a single Catalog source. It’s the SAP Commerce Cloud connector’s implementation of the broader multi-market sources capability, available in the v3 and v4 branches only.

The SAP Commerce connector setup is the same for both ingestion modes, apart from a few single-source/multi-market differences. Follow Push data to Coveo (SAP Commerce Cloud 2011 or later) for the complete connector setup, and apply the following single-source/multi-market differences described in this article:

All other connector configuration (installation, credentials, search provider, index configuration, cron jobs, field mappings, and the remaining value providers) is identical to the standard setup.

For the Coveo organization side of the setup (dictionary fields, catalog view definitions, catalog filters, and search tokens), see Multi-market sources.

Important

Single-source multi-market relies on the multi-market sources feature, which is in early access. Contact your Coveo representative to have it enabled for your Coveo organization.

About the multi-market modes

The connector has two mutually exclusive modes of operation. You select the mode with a single global property that applies to every index configured in your SAP Commerce instance. You can’t run one index in one mode and another index in the other mode within the same instance.

Mode 1: Multi-source/multi-market

Market-specific values are pushed to separate Catalog sources, one per market. For example, for a storefront with two markets, the connector pushes each product to two sources, with market A values going to source A and market B values going to source B. This mode is also used for single-market setups.

Mode 2: Single-source/multi-market

A single Catalog source holds market-specific values (such as name, description, and price) as dictionary fields. The connector pushes one product item, with localized values stored as key-value pairs, to one source.

Choose a mode

Use the following guidance to decide which mode fits a given implementation:

  • Single market, with no plans to add markets: Use mode 1. Mode 2 adds configuration overhead even for a single market (for example, catalog view definitions and search tokens), so there’s no benefit to it when a client serves one market and doesn’t expect to expand.

  • Single market, but likely to add markets later: Consider starting with mode 2.

  • Multiple markets: Use mode 2 to power all markets from a single source, or mode 1 to use a separate source per market.

Note

This guidance should be applied at the discretion of the team handling the implementation. Contact your Coveo representative if you’re unsure which mode suits your deployment.

Prerequisites

Enable single-source multi-market mode

The connector mode is controlled by the coveo.multimarket.singlesource property in the searchprovidercoveosearchservices/project.properties file:

  • false (default): the connector uses mode 1 (multi-source/multi-market).

  • true: the connector uses mode 2 (single-source/multi-market).

Set this property in your project’s local.properties file to override the default value configured in the connector extension:

coveo.multimarket.singlesource=true
Important

This property is read once to instantiate a Java class when the SAP Commerce instance starts. Changing the value on a running instance through the HAC (Hybris Administration Console) doesn’t change the connector’s behavior at runtime. To switch modes, update the property value and restart your SAP Commerce instance.

Configure the product source

In the standard setup, each CoveoSource specifies the language, currency, and country it applies to:

INSERT_UPDATE CoveoSource; id[unique = true]; name[unique = true]; language(isocode); currency(isocode); country(isocode); objectType(code); consumedDestination(id)
; electronics-zh-USD-US-source; Electronics Chinese Dollar USA Source; zh; USD; US; PRODUCTANDVARIANT; electronics-zh-USD-US-dest

Because single-source/multi-market pushes all market-specific values to one source, these qualifiers aren’t needed. Leave the language, currency, and country columns empty:

INSERT_UPDATE CoveoSource; id[unique = true]; name[unique = true]; language(isocode); currency(isocode); country(isocode); objectType(code); consumedDestination(id)
; electronics-zh-USD-US-source; Electronics Chinese Dollar USA Source; ; ; ; PRODUCTANDVARIANT; electronics-zh-USD-US-dest

For a complete mode 2 configuration, see the electronics-multimarket-singlesource-configuration-example.impex example file in the connector code base. You can use it as a template to fill with your data and configure your project faster.

Configure the item title

In mode 1, a product’s name and content-browser title are identical, so the connector reuses the mandatory name value for both.

In mode 2, this is no longer true: ec_name is a localized dictionary field (a map of localized values), while the title shown for the item in the Content Browser (platform-ca | platform-eu | platform-au) must be a single string. To resolve this, use the coveoMultiMarketSingleSourceDocumentTitleSnIndexerValueProvider value provider to set the specific language used for the item title.

Configure the value provider through the valueProviderParameters:

  • defaultLanguage sets the language used for the title (for example, zh).

  • expression sets the model attribute used to populate the title value (for example, name).

Because the title now comes from this value provider, you also configure the dictionary field that maps to ec_name. The following example configures both the name (title) and ec_name fields:

INSERT_UPDATE SnField; indexType(id)[unique = true]; id[unique = true]; name; fieldType(code); localized[default = false]; valueProvider; valueProviderParameters[map-delimiter = |]; qualifierTypeId
; $coveoProductIndexType; name; Name; TEXT; true; coveoMultiMarketSingleSourceDocumentTitleSnIndexerValueProvider; defaultLanguage->zh|expression->name; ;
; $coveoProductIndexType; ec_name; EC_Name; TEXT; true; productAttributeSnIndexerValueProvider; expression->name;
Note

When an SnField is configured as localized, the standard SAP Commerce value providers return a map of localized values. In mode 2, the connector pushes that map as a dictionary field. In mode 1, the connector instead determines the localized value relevant to each per-market source. This is why ec_name is configured as a localized dictionary field in mode 2.